Blank pdfs when printing from web - parse error - anything I can do?

411 views
Skip to first unread message

Natalie

unread,
Jan 22, 2021, 11:03:34 PM1/22/21
to wkhtmltopdf General
Hi all, this is my first time with wkhtmltopdf and it looks like a great tool.

However whilst most websites are fine I am getting blank pages when I try to print from the specific online forms that I need.  I've created the simplest possible case and have put in a long javascript-delay but am still getting blank pages.  Having put in the debug I can see there's a warning for a parse error in the page's javascript.

I have no control over the code on the web pages that I am printing - and they load fine onscreen and manually print fine either to pdf or other printing mechanisms.

Is there anything I can do differently to make this work through wkhtmltopdf?  

wkhtmltopdf --enable-javascript --javascript-delay 5000 --debug-javascript --no-background --load-error-handling ignore https://ee.humanitarianresponse.info/single/xijUsOiQ testing.pdf

gives me

Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done

Thank you for any advice,

Natalie

George Reynolds

unread,
Jan 23, 2021, 11:35:03 AM1/23/21
to wkhtmltop...@googlegroups.com
Hi 

This answer doesn't address your issue with wkhtmltopdf but you can run chrome in 'headless' mode ie without a GUI and it will create a PDF for you. 

It seems like this solution would work better for you with one or two pages, where you're not using a program eg in Python



That page should help you with the correct command.

Thanks 



--
===================================================
You received this message because you are subscribed to the "wkhtmltopdf General" group.
To post to this group, send email to wkhtmltop...@googlegroups.com
To unsubscribe from this group, send email to wkhtmltopdf-gen...@googlegroups.com
 
For more options, visit this group at
http://groups.google.com/group/wkhtmltopdf-general?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "wkhtmltopdf General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wkhtmltopdf-gen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wkhtmltopdf-general/daae3a46-c085-4ec6-b4c7-74658601e41fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages