jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

JSPDF adding images to header and footer

Open fireholster opened this issue 9 years ago • 8 comments

Hi - I have a pdf that is using autotable and latest jspdf versions. I am trying to add an image to header and footer of the pdf. But the pdf is coming back as blank in the plnkr i have created.

https://plnkr.co/edit/okwxsY6IuDlKLMxOtUd8

with that said while i am trying this on my actual application i am getting this error: jsPDF Warning: rendering issues? provide a callback to fromHTML?

Can someone please help?

fireholster avatar May 21 '17 19:05 fireholster

https://plnkr.co/edit/trrLAn6I9o2OwSkRFBZK?p=preview

Access to Image at 'http://www.snopes.com/politics/graphics/snowhead.png' from origin 'https://run.plnkr.co' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://run.plnkr.co' is therefore not allowed access. VM382:1

Access to Image at 'https://www.drupal.org/files/issues/header_1.png' from origin 'https://run.plnkr.co' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://run.plnkr.co' is therefore not allowed access.

Uzlopak avatar May 21 '17 21:05 Uzlopak

ah my bad.. well what about the other issue where the image is in the same in my website but when it executes it is giving error jsPDF Warning: rendering issues? provide a callback to fromHTML?

fireholster avatar May 21 '17 21:05 fireholster

Well, I added in the sample code a callback function... didn't I?

Uzlopak avatar May 21 '17 21:05 Uzlopak

in the callback you have to do the doc.output()

Uzlopak avatar Dec 31 '17 18:12 Uzlopak

here it is fixed https://plnkr.co/edit/Y3sD4g4uv8LhYjTEKgcy?p=preview

please close this issue

Uzlopak avatar Dec 31 '17 20:12 Uzlopak

#1567 Should be closed reasons:

  • issuer didnt react on answers
  • more like an open question than a real issue
  • not an issue because plugin is working as expected
  • solution was posted by me

Uzlopak avatar Dec 31 '17 20:12 Uzlopak

I know it's old, but it doesn't work.

krini avatar May 18 '18 12:05 krini

@krini Please open a new issue.

Uzlopak avatar May 18 '18 14:05 Uzlopak