this question on wkhtmltopdf has a specific component and a more general component to it.
generally: i am trying to extract a wide range of webpages into pdf files and i want wkhtmltopdf to work in as many cases as possible. its a pretty good tool but i often meet problems when it couldn't convert webpages. do you guys have a go-to set of flags that you use with wkhtmltopdf?
specifically: for example, a webpage that isn't anything far-out, but i am having problems with is http://gizmodo.com/microsoft-surface-book-review-so-good-i-might-switch-1737680767. when i run wkhtmltopdf without any flags (in Windows), i get the following:
>>wkhtmltopdf http://gizmodo.com/microsoft-surface-book-
review-so-good-i-might-switch-1737680767 blah.pdf
Loading pages (1/6)
Error: Failed loading page http://gizmodo.com/microsoft-surface-book-review-so-g
ood-i-might-switch-1737680767 (sometimes it will work just to ignore this error
with --load-error-handling ignore)
Warning: A finished ResourceObject received a loading progress signal. This migh
t be an indication of an iframe taking too long to load.
Warning: Received createRequest signal on a disposed ResourceObject's NetworkAcc
essManager. This might be an indication of an iframe taking too long to load.
Exit with code 1, due to unknown error.
if i follow the instructions and use the --load-error-handling ignore
flag, the PDF file is generated, but its empty. how do i get wkhtmltopdf to work with this webpage?
i tried to look at other tools such as phantomJS with rasterize.js, but it has its own set of problems...
thanks guys!
Turns out its actually quite simple! simply use the "-n" flag! works like a charm!