原因可能是:
- 文件路径问题 (没有文件夹,文件名有非法字符等)
- 文件打开中
Traceback (most recent call last):
File "C:/Users/Administrator/OneDrive/all_huaqiu/huaqiu_spider/func.py", line 445, in <module>
to_pdf(file_path, '', '1234')
File "C:/Users/Administrator/OneDrive/all_huaqiu/huaqiu_spider/func.py", line 203, in to_pdf
pdfkit.from_string(src_html, file_path, configuration=configs, options=options)
File "C:\ProgramData\Anaconda3\lib\site-packages\pdfkit\api.py", line 72, in from_string
return r.to_pdf(output_path)
File "C:\ProgramData\Anaconda3\lib\site-packages\pdfkit\pdfkit.py", line 156, in to_pdf
raise IOError('wkhtmltopdf reported an error:\n' + stderr)
OSError: wkhtmltopdf reported an error:
Loading pages (1/6)
QPainter::begin(): Returned false
Error: Unable to write to destination
Exit with code 1, due to unknown error.






网友评论