我在 powershell 中从 SQL 创建了一个 HTML 文档。现在,当我尝试使用 wkhtmltopdf 将 HTML 文档导出为 PDF 时,没有显示来自 HTML 文档的图像。如果我要从谷歌创建 PDF,图像将很好地导出:
$html = "https://www.google.com"
$pdf = "c:\temp\googletest.pdf"
& "C:\Windows\wkhtmltopdf\bin\wkhtmltopdf.exe" $html $pdf | Out-Null
如果我尝试从本地 HTML 文档中执行此操作,则不会出现任何图像:
$html = "file:///C:/Temp/htmltest.htm"
$pdf = "c:\temp\test.pdf"
& "C:\Windows\wkhtmltopdf\bin\wkhtmltopdf.exe" $html $pdf | Out-Null
我究竟做错了什么?