One of the main things that seem different in your PDF output is the font. wkhtmltopdf requires the fonts to be installed on your operating system just as a browser would require. It is possible that differences in spacing and font sizes affect the layout of your page. First you should see what fonts you are trying to use in the source file and install them on your server. A good start is to install basic Microsoft fonts from here or from server distribution repositories.
Alternative way: use @font-face directives in your stylesheets of the source file to refer to fonts from the URL without installing them on your server:
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/CWB0XYA8bzo0kSThX0UTuA.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; }
For Google web fonts, you can import your stylesheets instead:
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" />
Another thing to check is the wkhtmltopdf versions on your workstation and on your server. Running wkhtmltopdf --version will tell you your installed version. Your server may have an outdated version of wkhtmltopdf installed. The easiest way to install the latest version of wkhtmltopdf with the necessary functions is here , where you can download statically linked Linux files for any distribution.
The last thing to try is to use different arguments --margin-top , --margin-right , --margin-bottom and --margin-left . There is also a flag called --viewport-size , which can help get better results.
wkhtmltopdf --viewport-size 1024x768 page.html output.pdf
If you use the same version of wkhtmltopdf both on your workstation and on the server, these configuration parameters should not matter, since you stated that you are using the same configuration for both already.