I am in need of your support on the following issue since its pulling me for a while. We have a small c#
utility, which print given PDF
using Gho
You could use GSPRINT.
I've managed to make it work by only copying gsprint.exe/gswin64c.exe/gsdll64.dll in a directory and launch it from there.
sample code :
// This uses gsprint (mind the paths)
private const string gsPrintExecutable = @"C:\gs\gsprint.exe";
private const string gsExecutable = @"C:\gs\gswin64c.exe";
string pdfPath = @"C:\myShinyPDF.PDF"
string printerName = "MY PRINTER";
string processArgs = string.Format("-ghostscript \"{0}\" -copies=1 -all -printer \"{1}\" \"{2}\"", gsExecutable, printerName, pdfPath );
var gsProcessInfo = new ProcessStartInfo
{
WindowStyle = ProcessWindowStyle.Hidden,
FileName = gsPrintExecutable ,
Arguments = processArgs
};
using (var gsProcess = Process.Start(gsProcessInfo))
{
gsProcess.WaitForExit();
}