Can someone tell me how to resolve following issues?
wkhtmltopdf don't have option to pass proxy info (-p or --proxy) unlike in previous versions and its not using system $http_proxy and $https_proxy env variable too.
wkhtmltopdf not working with HTTPS/SSL even though i set LD_LIBRARY_PATH for libssl.so and libcrypto.so
[deploy@localhost ~]$ wkhtmltopdf https://www.google.co.in google.pdf loaded the Generic plugin Loading page (1/2) Error: Failed loading page https://www.google.co.in (sometimes it will work just to ignore this error with --load-error-handling ignore) Exit with code 1 due to network error: UnknownNetworkError
and
[deploy@localhost ~]$ wkhtmltoimage https://www.google.co.in sample.jpg loaded the Generic plugin Loading page (1/2) Error: Failed loading page https://www.google.co.in (sometimes it will work just to ignore this error with --load-error-handling ignore) Exit with code 1 due to network error: UnknownNetworkError
wkhtmltopdf working partially with HTTP. The output pdf files missing some content/background/positions.
[deploy@localhost ~]$ wkhtmltopdf http://localhost:8880/ sample.pdf loaded the Generic plugin Loading page (1/2) Printing pages (2/2) Done Exit with code 1 due to network error: ContentNotFoundError [deploy@localhost ~]$ wkhtmltoimage http://localhost:8880/ sample.jpg loaded the Generic plugin Loading page (1/2) Rendering (2/2) Done Exit with code 1 due to network error: ContentNotFoundError
Note: Im using wkhtmltopdf-0.12.1-1.fc20.x86_64 and qt-4.8.6-10.fc20.x86_64
Unfortunately
wkhtmltopdf
doesn't handle downloading of complex websites, because it's uses Qt/QtWebKit library which seems to have some issues.One problem is that
wkhtmltopdf
doesn't support relative addresses (GitHub: #1634, #1886, #2359, QTBUG-46240) such as:and it loads them as local. One solution which I've found to this is the correcting html file in-place by
ex
in-place editor:However it won't work for files which have these type of URLs on the remote.
Another problem is that it doesn't handle missing resources. You can try to specify
--load-error-handling ignore
, but in most cases it doesn't work (see #2051), so this is still outstanding. Workaround is to simply remove these invalid resources, before conversion.Alternatively to
wkhtmltopdf
, you can use eitherhtmldoc
, PhantomJS with some additional script, for example using rasterize.js:or dompdf (HTML to PDF converter for PHP, you can install by composer) with sample code below:
my problem was solved removing @font-face from css.