我正在尝试使用以下命令将 PowerShell 中的 PDF 文件打印到另一个 PDF(以删除某些属性)较早的线程 https://stackoverflow.com/questions/52785842/print-a-pdf-to-a-file-in-powershell。它本质上与我使用的代码相同,但我添加了“Microsoft Print to PDF”作为打印机。它不会抛出任何错误,但似乎只是生成一个空白的 pdf。
$PrintDocument = New-Object System.Drawing.Printing.PrintDocument
$PrintDocument.DocumentName = "c:\temp\fileToOpen.pdf"
$printDocument.PrinterSettings.PrintToFile = $true
$PrintDocument.PrinterSettings.PrinterName = "Microsoft Print to PDF"
$printDocument.PrinterSettings.PrintFileName = "c:\temp\newFile.pdf" #this is the blank file
$PrintDocument.Print()
有谁知道我在这里做错了什么?非常感谢
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)