问题
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