简体   繁体   English

wkhtmltopdf 不会显示 jpg 图像

[英]wkhtmltopdf won't display jpg images

I'm having a bit of a problem with wkhtmltopdf.我对 wkhtmltopdf 有点问题。 It won't display jpg images but works perfectly with png images.它不会显示 jpg 图像,但可以与 png 图像完美配合。 I've tried converting the images to base64 and inserting them directly into my html.我尝试将图像转换为 base64 并将它们直接插入到我的 html 中。 When i render the html it works, but it won't when i pass the html file to wkhtmltopdf.当我渲染 html 时它可以工作,但是当我将 html 文件传递给 wkhtmltopdf 时它不会。

I get no error from when i execute the command and the PDF is generated smoothly, it just lacks the images.当我执行命令并且 PDF 顺利生成时,我没有收到任何错误,它只是缺少图像。

I'm using wkhtmltopdf 0.12.3.2 on Debian 9 Stretch.我在 Debian 9 Stretch 上使用 wkhtmltopdf 0.12.3.2。

Does anyone have the same issues?有没有人有同样的问题?

I upgraded to wkhtmltopdf 0.12.5 and it solved the problem我升级到 wkhtmltopdf 0.12.5 并解决了问题

For those who have the same problem, here is how I managed to upgrade:对于那些有同样问题的人,这是我设法升级的方法:

sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb

sudo dpkg -i wkhtmltox_0.12.5-1.stretch_amd64.deb

sudo apt-get install -f

sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin

sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM