wkhtmltopdf,0.12.6,警告:阻止访问文件 [英] wkhtmltopdf, 0.12.6, Warning: Blocked access to file

查看:40
本文介绍了wkhtmltopdf,0.12.6,警告:阻止访问文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当将wkhtmltopdf升级到0.12.6时,出现这样的消息并且图像没有显示在目标pdf中:

When upgrade wkhtmltopdf to 0.12.6, it came to such messages and the image did not show in the target pdf:

    Warning: Blocked access to file /path/to/bpa_product_layering.png

顺便说一句,相同的源 html 文件适用于 0.12.5

BTW, the same source html file works well with 0.12.5

推荐答案

这是由 wkhtmltopdf 的 0.12.6 版本中的默认行为更改引起的.wkhtmltopdf 现在默认禁用本地文件访问.可以通过添加命令行参数来解决

This is caused by the change of default behavior in version 0.12.6 of wkhtmltopdf. wkhtmltopdf disables local file access by default now. It could be solved by adding the command line parameter

--enable-local-file-access

或组合

--disable-local-file-access --allow <path>

这篇关于wkhtmltopdf,0.12.6,警告:阻止访问文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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