Jspdf and addHTML / blurry font

I am generating a PDF file from an HTML page using the jspdf addHTML plugin. This works, but the displayed text / font is really blurry, the original HTML page is not. Image rendering is in order, the problem is only in the text (see. Attached images).

original_image: http://111900.test-my-website.de/stackoverflow/orig.jpg

blurry_image: http://111900.test-my-website.de/stackoverflow/blurry.jpg

I read all the Google results for the last three days - maybe I'm the only person in the world, I have exactly this problem?!?! : /

I have added the following scripts to my code:

  • spdf.js
  • jspdf.plugin.from_html.js
  • jspdf.plugin.split_text_to_size.js
  • jspdf.plugin.standard_fonts_metrics.js

PDF generation code: pdf.addHTML(document.getElementById("container"),10,15,function() { var string = pdf.save(filename); });

jspdf , ? ?

,

+5
2

, PDF addHtml -. , .

addHTML width, , . , addHTML.

0

, . , , 'dpi', . , - "" , . API , :

1- html2canvas: 1.0.0-alpha.

2- :

const context = canvas.getContext('2d');
context.scale(2, 2);
context['dpi'] = 144;
context['imageSmoothingEnabled'] = false;
context['mozImageSmoothingEnabled'] = false;
context['oImageSmoothingEnabled'] = false;
context['webkitImageSmoothingEnabled'] = false;
context['msImageSmoothingEnabled'] = false;
0

All Articles