wkhtmltopdf relative paths in HTML with redirected in/out streams won't work

做~自己de王妃 提交于 2019-12-05 08:06:20

Looking quickly, I think the trouble might be with

psi.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory;

I think that is where the paths are pointing at. I'm assuming that

"c:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" test.html test.pdf

working means that your image referenced inside test.html as src="mlp.png" is at c:\Program Files\wkhtmltopdf\bin\mlp.png, right? I think that it works because your image file is in the same folder as wkhtmltopdf... so try setting the WorkingDirectory to that directory and see what happens.

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