Hi,
I'm new to ghostscript but I have managed to print a pdf file in a WPF application using the commandline api for Ghostscript and GSView.
This is my working code:
I'm new to ghostscript but I have managed to print a pdf file in a WPF application using the commandline api for Ghostscript and GSView.
This is my working code:
string gsExecutable = string.Format(@"{0}", _config.GhostScript_Executable_Path);
string gsViewExecutable = string.Format(@"{0}", _config.GSView_Executable_Path);
string printerName = _config.MyPrinterName;
string processArgs = string.Format("-ghostscript \"{0}\" -dPDFFitPage -copies=1 -all -printer \"{1}\" \"{2}\"", gsExecutable, printerName, PDFFilePath);
var gsProcessInfo = new ProcessStartInfo
{
WindowStyle = ProcessWindowStyle.Hidden,
FileName = gsViewExecutable,
Arguments = processArgs
};
using (var gsProcess = Process.Start(gsProcessInfo))
{
gsProcess.WaitForExit();
gsProcess.Disposed += (ps, pe) =>
{
//Printing success!!
};
}
I'm wondering now how I can achive this with the Ghostscript.NET library? Can someone help me with an example for the things I'm already doing in a Ghostscript.NET way?