Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wkhtmltopdf generates from PDF format on Ubuntu without X Server


Is it possible to set format of PDF to generate in wkhtmltopdf?
From my PC wkhtmltopdf generates format "PDF-1.4"

enter image description here

But remote Ubuntu 14.04 server that is generating pdf with a 'virtual' X server using xvfb giving format PDF-0:

enter image description here


The only problem is opening generated pdf file in Chrome :)
Chrome cannot open PDF-0.

Thanks

like image 240
DAKZH Avatar asked Dec 28 '15 12:12

DAKZH


1 Answers

It looks like the resulting PDF from xvfb might not be 100% correct. There are some problems with the meta data. It's missing the creator for example. Also PDF-0 does not appear to be a valid PDF version. There might be other problems with the document. This would be a possible reason why the generated file does not appear in Chrome.

A good way to examine the document would be using Acrobat's preflight tool. It will inspect the document for potential problems, and that could give provide a clue on what's going on. The tool is located under "Print Production" in Acrobat. The profile to run is called "Report PDF syntax issues". I'm sure there are other tools out there that can also explain what is wrong with the document.

This section should provide a resolution to the problem. As mentioned in the comments below, updating the QT version from 4.8.6 to something newer should resolve the issue. The working setup appears to be running 5.3.2, while the non working one is under QT 4.8.6.

like image 116
Vel Genov Avatar answered Sep 20 '22 15:09

Vel Genov