0

I have a html page. There are two images on this page. both images are base64 encoded. I am printing images on html as

<img src='data:image/png;base64,<?php echo $img ?>' />

I set css properties position, left and right to bring one image over other image.

Now I am using jsPDF to generate pdf file of a section of the page where these 2 images are present.

generated pdf files from jsPDF works fine if I open it on FireFox , chrome or Document Viewer (ubuntu machine) but if I try to open this pdf file on a windows machine with Adobe reader then Adobe reader throws an error: There was an error processing a page. There was a problem reading this document (110) PDF error

If any one has any suggestion then kindly let me know.

Dour High Arch
  • 21,513
  • 29
  • 75
  • 90
Akash Dwivedi
  • 19
  • 1
  • 8
  • What Version of Adobe reader do you have on Windows? May be you should have a look at https://forums.adobe.com/thread/1028049 – Satya Apr 26 '18 at 23:21

1 Answers1

1

I had a similar issue using the fromHTML plugin, apparently the code puts out the text color resulting in it placing "rgb(0, 0, 0)" in places it should not.

The github recomended changing jspdf.dist.js in the line:

this.pdf.internal.write("q", "BT 0 g", this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), style.color, "Td");

changing the "style.color" to "null" solved my issue.

this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), null, "Td");
lolorivera
  • 26
  • 4