1
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();
 }
4

1 に答える 1

1

プリンターのデフォルトを希望どおりに設定する必要があります。(バニラバージョンでは) gsprint に照合を設定することはできません。

または、もちろん gsprint を変更して新しいコマンド ライン パラメータを受け入れ、それを使用してプリンタの照合を制御することもできます。

NB AutoRotatePages と PDFSETTINGS は、pdfwrite デバイス以外では効果がなく (物理プリンターではそうではありません)、PreserveOverprint はどのデバイスでも効果がありません。PDFFitPage は、入力が PDF ファイルの場合にのみ機能します。

于 2015-10-17T14:06:57.633 に答える