PdfTron 打印多份副本未正常工作

huangapple go评论90阅读模式
英文:

PdfTron printing multiple copies not work correctly

问题

在使用pdftron sdk打印多份副本时,遇到以下情况,

  • 文档页数为奇数
  • 打印2份副本
  • 双面打印

文档没有正确分隔。也就是说,第二份文档的第一页打印在第一份文档的纸张的另一面。

打印模式设置如下:

public static PrinterMode GetPdfPrint(PrinterInformation printerInformation, PrintQueue printQueue, int numberofCopies)
{
    PrinterMode printerMode = new PrinterMode();

    printerMode.SetDuplexing(PrinterMode.DuplexMode.e_Duplex_Auto);

    printerMode.SetCollation(true);

    printerMode.SetAutoRotate(true);

    printerMode.SetCopyCount(numberofCopies);

    printerMode.SetScaleType(PrinterMode.ScaleType.e_ScaleType_FitToOutputPage);

    printerMode.SetAutoCenter(true);

    return printerMode;
}

有人能帮助我让第二份副本从新的纸张开始吗?

英文:

When printing multiple copies with pdftron sdk with following circumstances,

  • document having odd number of pages
  • printing 2 copies
  • double sided printing

The documents not separate correctly. That is, 1st page of 2nd document printed on other side of the sheet of 1st document.

Print mode is set as follows,

public static PrinterMode GetPdfPrint(PrinterInformation printerInformation, PrintQueue printQueue, int numberofCopies)
        {
            PrinterMode printerMode = new PrinterMode();

            printerMode.SetDuplexing(PrinterMode.DuplexMode.e_Duplex_Auto);

            printerMode.SetCollation(true);

            printerMode.SetAutoRotate(true);

            printerMode.SetCopyCount(numberofCopies);

            printerMode.SetScaleType(PrinterMode.ScaleType.e_ScaleType_FitToOutputPage);

            printerMode.SetAutoCenter(true);

            return printerMode;
        }        

can someone help me to get the second copy starts from new sheet?

答案1

得分: 0

我无法找到pdftron方面的解决方案,所以采用了手动逻辑来解决这个问题。

{
  Page blankPage = pdfdoc.PageCreate();
  pdfdoc.PagePushBack(blankPage);
}
                                
pdfdoc.InitSecurityHandler();
                                
Print.StartPrintJob(pdfdoc, printQueue.FullName, documentName, string.Empty, new PageSet(1, pdfdoc.GetPageCount(), PageSet.Filter.e_all), printerMode, null);
英文:

I was not able find a solution by pdftron side to the question so, went with a manual logic to address the question.

 if(pdfdoc.GetPageCount()%2 != 0 && numberofCopies > 1 && printDuplex != Duplex.Simplex)
{
  Page blankPage = pdfdoc.PageCreate();
  pdfdoc.PagePushBack(blankPage);
}
                                
pdfdoc.InitSecurityHandler();
                                
Print.StartPrintJob(pdfdoc, printQueue.FullName, documentName,string.Empty, new PageSet(1, pdfdoc.GetPageCount(), PageSet.Filter.e_all), printerMode, null);
                            

huangapple
  • 本文由 发表于 2023年8月9日 13:52:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76864916-2.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定