Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
58
rated 0 times [  65] [ 7]  / answers: 1 / hits: 86811  / 10 Years ago, wed, april 2, 2014, 12:00:00

I am using jsPDF and it uses html2canvas to generate an image from some html element and insert on the .pdf file. But there is a problem on html2canvas, it generates blurry images from the html. See example below:



HTML content:



http://puu.sh/7SZz4.png



html2canvas generated image:



http://puu.sh/7SZAT.png



Is there any way to fix it or is there any better option to get the image form html?



thanks!


More From » html

 Answers
40

I have found out my problem. Happens that my screen is a Retina Display, so when the canvas2html will render the HTML, due to the difference of pixel density on retina screen, the image is rendered blurred.



Found out the solution here:



https://github.com/cburgmer/rasterizeHTML.js/blob/master/examples/retina.html


[#71665] Monday, March 31, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
josiah

Total Points: 208
Total Questions: 105
Total Answers: 107

Location: Seychelles
Member since Mon, Jun 28, 2021
3 Years ago
;