3
votes

I'm using wkhtmltopdf 0.12.5 on a Windows and on a Linux machine and experiencing a totally different font size rendering as you can see below.

Source HTML rendering within a browser enter image description here

PDF on Windows => OK enter image description here

PDF on Linux => NOK enter image description here

wkhtmltopdf settings

$PDFSettings = array(
    'outline',
    'margin-top'    => '10mm',
    'margin-left'   => '10mm',
    'margin-bottom'  => '0',
    'margin-right'   => '0',
    'disable-smart-shrinking',
    'dpi' => 300,
    'image-quality' => 300,
    'page-size' =>'A4',
    'zoom' => 1);

It's exactly the same PHP application running on both systems (development and integration) wich works fine on Windows but not on Linux.

I've already played around with the dpi and the zoom settings, which did not change anything.

Does anybody has an idea how I could fix this?

1
Something with teh fonts that are installed, and teh default font used when you don't specify which to use?ivanivan
Thanks @ivanivan. There seems to be different versions of Arial on Windows and Linux so I'm no referencing on an arial.woff file to use the same version everywhere. If you put your comment it as an answer, I'll accept it.TobyU

1 Answers

3
votes

I would bet that there is a difference in the fonts installed on the two systems - either different fonts period or different implementations of the font. Possibly a difference in the default font/size used if you don't specify one.

You might want to check if you can get the matching font from the ttf-mscorefonts-installer package (Debian/Ubuntu systems - I'm sure RH/CentOS and others have a similar package)