无法在ADO管道内的Python中从多个html文件创建pdf

发布于 2025-01-16 06:53:08 字数 675 浏览 3 评论 0原文

无法在 ADO 管道内的 python 中从多个 html 文件创建 pdf,但如果我传递一个文件,则会生成报告。

bash 内部:

sudo apt-get update --fix-missing
sudo apt-get install -y wkhtmltopdf

Python 脚本:

frontPage =  os.path.join(fileName, 'frontPage.html')
index = os.path.join(fileName, 'index.html')
// providing 1 file
pdfkit.from_file([fileName],"report.pdf") //works perfectly fine

// providing multiple files
pdfkit.from_file([frontPage, index],"report1.pdf") //showing error 

错误: 但对于单个 HTML 文件,正在工件中创建报告。并且 HTML 文件的路径是正确的。

在此处输入图像描述

期望生成具有多个 html 的 PDF

unable to create pdf from multiple html files in python inside ADO pipeline, but if I pass one single file then the report is being generated.

inside bash:

sudo apt-get update --fix-missing
sudo apt-get install -y wkhtmltopdf

Python script:

frontPage =  os.path.join(fileName, 'frontPage.html')
index = os.path.join(fileName, 'index.html')
// providing 1 file
pdfkit.from_file([fileName],"report.pdf") //works perfectly fine

// providing multiple files
pdfkit.from_file([frontPage, index],"report1.pdf") //showing error 

error:
but for single HTML file, report is being created in artifacts.and the path of the HTML files are correct.

enter image description here

expecting to generate PDF with multiple htmls

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文