【发布时间】:2019-03-08 11:11:17
【问题描述】:
我需要将 PDF 文件打印到一些基于硬件的打印机和一些虚拟 PDF 打印机。我正在使用 Ghostscript 来完成这项任务,编程语言是 C#。
硬件打印机在每个文档之后打印一个 PrintJob 页面,其中包含一些信息,例如日期/时间和文档名称。
虚拟打印机打印文档,但名称不同。 (Ghostscript 文档)
我在使用 Ghost 脚本时无法更改/或设置文档名称,感谢任何帮助。
using (GhostscriptProcessor processor = new GhostscriptProcessor())
{
List<string> switches = new List<string>
{
//"-empty",
"-dPrinted",
"-dBATCH",
"-dNOPAUSE",
"-dNoCancel",
"-dNOSAFER",
"-dNumCopies=1",
"-sDEVICE=mswinpr2",
"-sDocumentName=" + String.Format("\"{0}\"",Path.GetFileName(fileName)),
"-sOutputFile=%printer%" + printerName ,
"-f",
fileName
};
processor.StartProcessing(switches.ToArray(), null);
}
开关“sDocumentName”不起作用,我仍然看到使用默认名称打印文档 - “Ghostscript Document”
【问题讨论】:
标签: pdf printing ghostscript silent ghostscript.net