windows环境,在使用wkhtmltopdf插件将html转为pdf文档时报错:
Warning: Blocked access to file xxx/logo.png
Failed to load about:blank, with network status code 301 and http status code 0 - Protocol "about" is unknown"
解决方案:
排查了是由于其他代码导致出现此错误的可能后,单独使用wkhtmltopdf命令时,仍然报错,
根据报错信息:没有访问本地文件的权限
在执行命令加上参数:wkhtmltopdf -n --enable-local-file-access xx.html xx.pdf
参考链接: