PdfTron打印多份副本无法正常工作。

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

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方面找到解决这个问题的方法,所以采用了手动逻辑来解决这个问题。

如果(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);
                            
英文:

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.html
匿名

发表评论

匿名网友

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

确定