1

I use wkhtmltopdf (in fact django-wkhtmltopdf) to generate PDF.

I have to use xvfb because we need to run it on production server Ubuntu 16.04 too.

The problem is that for example tables have different sizes on production and on development server and the text color is different too.

On both servers it runs this way:

settings.py

WKHTMLTOPDF_CMD=xvfb-run --server-args="-screen 0, 1024x768x24" /usr/local/bin/wkhtmltopdf --zoom 1.04

development Ubuntu 18.04

enter image description here

production Ubuntu 16.04

enter image description here

Do you know what is wrong or how to debug this?

Milano
  • 18,048
  • 37
  • 153
  • 353
  • Does your screen 0 have the same DPI/zoom/scaling on both machines? If not, that could be your culprit. Furthermore that page size doesn't look at all like an A4 page. Can you properly print that? I'm looking at this old defect report and they use a lot more params and still run into dpi issues: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1563 – BoboDarph Oct 18 '18 at 11:20
  • Did you got any solution for this ? – CodeGeek Feb 09 '19 at 13:20
  • Are you using the same version on both servers? What worked for me was adding the `--disable-smart-shrinking` option. – gdvalderrama Nov 17 '21 at 12:03

0 Answers0