I have a requirement to print PDF files to some hardware based printers, and to some Virtual PDF Printers. I am using Ghostscript for this task and programming language is C#.
The hardware printers print a PrintJob page after each document, where there are some information like Date/Time and name of the document.
The virtual printers print the document but with a different name. (Ghostscript Document)
I am unable to change/ or set a Document Name while using Ghost Script, any help is appreciated.
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);
}
The switch 'sDocumentName' does not work, I am still seeing documents are getting printed with default name - "Ghostscript Document"