使用wkhtmltopdf时如何处理ContentNotFoundError? [英] How to deal with ContentNotFoundError when using wkhtmltopdf?

查看:963
本文介绍了使用wkhtmltopdf时如何处理ContentNotFoundError?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我如何解决以下问题吗?

Can someone tell me how to resolve following issues?


  1. wkhtmltopdf没有传递代理信息的选项(- p或--proxy),与以前的版本不同,它也不使用系统$ http_proxy和$ https_proxy env变量。

  1. 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甚至无法与HTTPS / SSL一起使用虽然我为libssl.so和libcrypto.so设置了LD_LIBRARY_PATH

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

[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部分使用HTTP。输出的pdf文件缺少某些内容/背景/位置。

  • 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
    


  • 注意:我使用wkhtmltopdf-0.12.1-1.fc20.x86_64和qt-4.8.6-10.fc20.x86_64

    Note: Im using wkhtmltopdf-0.12.1-1.fc20.x86_64 and qt-4.8.6-10.fc20.x86_64

    推荐答案

    我的问题已解决,从CSS中删除了@ font-face。

    my problem was solved removing @font-face from css.

    这篇关于使用wkhtmltopdf时如何处理ContentNotFoundError?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆