I try to generate a PDF with wkhtmltopfd from an OpenLayer V3 map, but I get only an empty image.
This code should generate a PDF with the map images, but it generates only the background of the map.
wkhtmltopdf --javascript-delay 5000 http://openlayers.org/en/v3.1.1/examples/moveend.html test.pdf
What am I doing wrong?
This is what I have already checked:
--background
and --images
, but with no success (these options are also marked as default options).Use window status switch "--window-status XXXX", If you add this switch the PDF component (wkhtmtopdf) will wait for the window-status , As soon as script set the window sataus to ready or anything given in the switch wkhtmltopdf start converting the html to PDF.
What you need to do…. Try to find when your maps are loaded in DOM and everything got rendered (ajax calls or any long running script has been done/succeeded) then set the window.sataus = "ready" (using java script)
add the switch "--window-status ready"
wkhtmltopdf --window-status ready http://openlayers.org/en/v3.1.1/examples/moveend.html test.pdf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With