wkhtmltopdf http error 1301 and 1005

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 14:37:40

问题


I'm trying to run wkhtmltopdf from my c# code but it keeps returning a 1301 or 1005 error. I can't find anything regarding these error codes, any ideas? I'm using the --print-media-type switch so I the pdf will look the same as if it were printed on a physical printer. The pdf does get created, it is just 0 bytes long.

here is the command line parameters:

wkhtmltopdf.exe http://google.com google.pdf --print-media-type

回答1:


After much heartache and frustration, I've discovered that the --print-media-type switch needs to be after the html location BUT BEFORE the pdf location.

wkhtmltopdf.exe http://google.com --print-media-type google.pdf 

works as desired.



来源:https://stackoverflow.com/questions/21784593/wkhtmltopdf-http-error-1301-and-1005

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!