我有一个我在本地开发的docfx 网站。我在我的 docfx.json 文件中添加了一个 pdf 对象,以便提供下载网站 pdf 的链接。我正在使用 wkhtmltopdf 来做同样的事情。它在本地工作正常并创建 pdf 文件,但是当我使用 Azure DevOps 构建管道时,管道代理会引发以下错误:
[20-07-24 03:41:21.067]Error:[PDF]Error happen when converting {filename}.json to Pdf. Details: iTextSharp.text.exceptions.InvalidPdfException: PDF header signature not found.
我的 docfx pdf 版本如下所示:
"pdf": {
"name": "ais",
"content": [
{
"files": [
"index.md",
"toc.yml"
]
},
{
"files": [
"Cloud Readiness/**.md",
"Cloud Readiness/toc.yml",
"Migrate/**.md",
"Migrate/toc.yml",
"Workload Landing Zone/**.md",
"Workload Landing Zone/toc.yml",
"Plan/**.md",
"Plan/toc.yml",
"Strategy/**.md",
"Strategy/toc.yml",
"Backlog/toc.yml",
"Backlog/**.md"
],
"src": ".."
}
],
"resource": [
{
"files": [
"Cloud Readiness/**.png",
"Cloud Readiness/**.jpg",
"Migrate/**.png",
"Migrate/**.jpg",
"Workload Landing Zone/**.png",
"Workload Landing Zone/**.jpg",
"images/**.png",
"Plan/**.png",
"Plan/**.jpg",
"Strategy/**.png",
"Strategy/**.jpg",
"Strategy/**.pptx"
],
"src": ".."
}
],
"dest": "_site/static/files",
"outline": "NoOutline",
"noStdin": true,
"keepRawFiles": true
}
我的 Azure DevOps Build 任务配置如下所示:
知道如何解决这个问题吗?