使用 Adobe Acrobat 以编程方式打印到文件

本文关键字:式打印 文件 编程 Adobe Acrobat 使用 | 更新日期: 2023-09-27 17:55:12

在Adobe Acrobat Reader的高级打印设置中,我注意到有一个打印到文件选项。 我目前正在开发一个 vb.net 函数库,该函数库可以打印各种格式的文件以打印语言文件(后记)。 但是,我似乎找不到以编程方式访问此功能的方法,有没有办法在不使用第三方工具的情况下执行此操作,因为我需要尽可能避免使用外部库。

使用 Adobe Acrobat 以编程方式打印到文件

您可以使用 PrintDocument 类在 FILE: 端口上打印到 PostScript 打印机。默认情况下,PostScript 打印驱动程序随 Windows 一起提供。 一个例子是 HP LaserJet 2800 PS,它随 Server 2008 一起提供。 通常,如果名称中包含PS,则打印机将能够打印到文件。

https://learn.microsoft.com/en-us/dotnet/api/system.drawing.printing.printersettings.printtofile

    ...
    printDocument1.PrinterSettings.PrintToFile = true
    printDocument1.PrinterSettings.PrintFileName = "c:'temp'test.ps"
    printDocument1.Print()