【问题标题】:how set collate = true while printing using gsprint使用 gsprint 打印时如何设置 collat​​e = true
【发布时间】:2015-10-17 08:30:29
【问题描述】:
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();
 }

【问题讨论】:

    标签: c#-4.0 printing properties ghostscript collate


    【解决方案1】:

    你需要按照你想要的方式设置打印机默认值,你不能(在香草版本中)让 gsprint 设置整理。

    当然,您也可以修改 gsprint 以接受新的命令行参数并使用它来控制打印机分页。

    NB AutoRotatePages 和 PDFSETTINGS 对 pdfwrite 设备没有影响(因此不适用于任何物理打印机),PreserveOverprint 对任何设备都没有影响。 PDFFitPage 仅在输入为 PDF 文件时才有效。

    【讨论】:

    • 你能给我示例如何传递该参数吗?
    • 您需要修改 gsprint C 源以接受新参数,并使用其值在打印结构中设置适当的成员。检查现有的源代码,它已经为其他参数这样做了。
    • 我有同样的问题,我尝试在我的 windows 打印机中设置默认打印机设置中的排序规则,但是当我发送 -dNumCopies 参数的值大于 1 时它不起作用。跨度>
    猜你喜欢
    • 2020-10-28
    • 2010-11-08
    • 2012-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-03
    • 1970-01-01
    • 2014-11-05
    相关资源
    最近更新 更多