eKoopmans/html2pdf.js

Generated File doesnt have images that were present on the webpage.

ishanavasthi opened this issue · 3 comments

image
image
The 2nd one is webpage where the options of the question are images.

yp-wu commented

It would be a CORS issue. Maybe this can help you.

You can also try changing the CORS settings for html2canvas when implementing:

`let opt = {

image: { type: 'jpeg', quality: 0.98 },

html2canvas: { scale: 2, useCORS: true}

};

html2pdf().set(opt).from(element).save();`

This unfortunately not works. I'm not sure why but the image itself is hosted on S3 with appropriate permissions. This is the error I got:

from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Any idea how to fix this?

update: turns out it works fine on Mozilla but failing in Chrome.