Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screen resolution wkhtmltopdf windows virtual server

Tags:

c#

wkhtmltopdf

I have a NT-Service installed on a virtual windows server (rackspace). This service is using wkhtmltopdf to generate a pdf from a webpage. The problem is that the PDF is generated with a screen resolution of 1024x768, default on server I guess.

Anybody faced this problem earlier? Can I change the virtual server screen resolution somehow?

like image 264
Erik Lindstrom Avatar asked Sep 30 '22 16:09

Erik Lindstrom


1 Answers

Adding switches --page-width 1600px --page-height 1200px to wkhtmltopdf did the trick. Then all printouts looks the same on all machines, no matter resolution etc.

like image 147
Erik Lindstrom Avatar answered Oct 16 '22 21:10

Erik Lindstrom