I am using laravel-snappy as a wrapper for wkhtmltopdf for creating PDFs out of HTML.
While running the same code with the same configuration, I am getting different outputs:
CentOS output: (centered correctly but with big margin at the bottom)
macOS output: (right part is cropped, and also theres a big margin at the bottom)
Both environments are using wkhtmltopdf 0.12.4 (with patched qt)
, any ideas for this difference?
There are a couple of things you can try:
--disable-smart-shrinking
--dpi 96
Experiment with this number to get consistent results (could be around 130)
--zoom 1.33
Set a font family that is common across platforms (see http://www.apaddedcell.com/sites/www.apaddedcell.com/files/fonts-article/final/index.html). Set with font-family: xxx, xxx, xxx, sans-serif
Another thing that has been mentioned before is to set the page dimensions in px instead of mm
--page-width 1588px --page-height 1210px
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With