Wkhtmltopdf and Phantomjs, large images are not displayed

  • GNU/Linux

I recently encountered a rather annoying problem when dynamically creating PDFs. To generate these PDFs, I used wkhtmltopdf and phantomjs is the problem was the same regardless of the tool used. Locally I had no problem, but once on the production server, only the small images (-200px) were displayed. In the different documentations I've browsed, it's advised to use xvfb-run but if you have this same problem, you should also assign a profile to it.

xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf