Getting black images after adding 27 images through addHTML
See original GitHub issueI using JS PDF v 1.3.3, with in angular2 project. I am generating pdf with addHTML function. Code works fine for 26 pages. onces it crosses 26 pages complete pdf is generted with black images. I am using below code to generate the pdf.
has any one faced this kind of issue?
this.pdfDoc.addHTML(this.pages[index], 0, 0, this @.options, () => {
let obj = this.getClientHeightWidth(index);
this.pdfDoc.addPage(obj.clientWidth, obj.clientHeight);
index++;
this.addPage(index);
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Getting black images after adding 27 images through addHTML
I using JS PDF v 1.3.3, with in angular2 project. I am generating pdf with addHTML function. Code works fine for 26 pages....
Read more >jsPDF addHTML exporting low quality image to PDF
It looks like that many are still using pdf.addHTML() and have the same low quality issue. pdf.addHTML() is actually deprecated now.
Read more >How To Create a Black and White Image - W3Schools
Use the CSS filter property to convert an image to black and white. Grayscale Example. Change the color of all images to black...
Read more >Adding custom code to your site - Squarespace Help Center
Enhance your site's style and appearance using advanced coding skills. You can build a website on Squarespace without coding or design...
Read more >How to change a black and white photo to COLOR in Photoshop
How to colorize a black and white photo in Photoshop. This Photoshop tutorial shows how to get a realistic color photo from a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
tbh, I dont know the syntax of angularJS. But if your code is grabbing the whole html-site, than it could be the buffer overflow.
https://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element Like I said… I guess it is a buffer overflow.
A4 are 595x 842 pixels. If we take chomes limit of 32,767 pixels than we have 38 pages to render.
It could be also the addImage-Problem. Go to the addImage Plugin and replace the jsPDFAPI.arrayBufferToBinaryString method by this code.
And then check again
@newdevsoft7 I had like 35 applications altogether and I was generating PDF pages for all of them together. Now I am generating one page at a time and clearing the DOM…