jsreport / jsreport-phantom-pdf

jsreport recipe which is rendering pdf from html using phantomjs
GNU Lesser General Public License v3.0
11 stars 8 forks source link

Rendering problems from HTML to PDF #6

Closed danykina closed 7 years ago

danykina commented 8 years ago

phantom-PDF not correctly renders HTML to CSS, in particular font, margin and padding, is not a bootstrap problem (@media print) has already been verified

bjrmatos commented 8 years ago

@danykina do you have some example?

danykina commented 7 years ago

example The rendering of the font from template wrote in jade into PDF, with phantom-pdf not work correctly. Because i set the font "Century Gothic" and the font-weight: 200, (400 is normal and 700 is bold) but when i print them to paper are bold and the letters are join together, it is hard to read. Sorry for my english, thanks.

pofider commented 7 years ago

Unfortunately there is not much we can do with such errors because it usually originates deep down in the third party stack we use. In particularly qtwebkit.

Here are hints I would recommend to try:

  1. Try using phantomjs2, if it works better for you - how to
  2. Try using different recipe like jsreport-wkhtmltopdf , it applies some patches to qtwebkit which could help
  3. Try using different recipe like jsreport-electron-pdf, this one is using latest chrome pdf rendering, but unfortunately doesn't support headers/footers
  4. Try playing with css sizing
body { transform-origin: 0 0; -webkit-transform-origin: 0 0; transform: scale(0.654545); -webkit-transform: scale(0.654545); }
  1. Try different font, phantomjs2 and electron-pdf should support webfonts