public void PrinterThread(string printerName, string fileName, bool portrait,string Copies)
{
string gsArguments, gsLocation;
ProcessStartInfo gsProcessInfo;
Process gsProcess;
if (portrait)
{
//gsArguments = string.Format("-dAutoRotatePages=/All -dNOPAUSE -dBATCH -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -dEmbedAllFonts=true -dSubsetFonts=true -dPDFSETTINGS=/prepress -dNOPLATFONTS -noquery -dNumCopies=" + Copies + " -all -colour -printer \"{0}\" \"{1}\"", printerName, fileName);
gsArguments = string.Format("-dAutoRotatePages=/ALL -dNOPAUSE -dBATCH -dPreserveOverSettings=/false -dNumCopies=" + Copies + " -printer \"{0}\" \"{1}\"", printerName, fileName);
// gsArguments = string.Format("-ghostscript \"{0}\" -copies=2 -all -printer \"{0}\" \"{1}\"", printerName, fileName);
// gsArguments = string.Format("-noquery -portrait -printer \"{0}\" \"{1}\"",
//printerName, fileName);
gsLocation = @"C:\Users\gokul.das\Desktop\Silent_Print\Silent_Print\bin\Debug\gsview\gsprint.exe";
}
else
{
gsArguments = string.Format("-dAutoRotatePages=/All -dNOPAUSE -dBATCH -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -dEmbedAllFonts=true -dSubsetFonts=true -dPDFSETTINGS=/prepress -dNOPLATFONTS -sFONTPATH=\"C:\\Program Files\\gs\\gs9.10\\fonts\" -noquery -dNumCopies==" + Copies + " -all -colour -printer \"{0}\" \"{1}\"", printerName, fileName);
//gsArguments = string.Format("-noquery -landscape -printer \"{0}\" \"{1}\"",
// printerName, fileName);
gsLocation = @"C:\Users\gokul.das\Desktop\Silent_Print\Silent_Print\bin\Debug\gsview\gsprint.exe";
}
gsProcessInfo = new ProcessStartInfo();
gsProcessInfo.WindowStyle = ProcessWindowStyle.Hidden;
gsProcessInfo.FileName = gsLocation;
gsProcessInfo.Arguments = gsArguments;
gsProcess = Process.Start(gsProcessInfo);
//gsProcess.WaitForExit();
}
问问题
347 次