c#设置页面范围打印问题 20
我的代码如下,打印xps文件varprinters=newLocalPrintServer().GetPrintQueues();varselectedPrinter=p...
我的代码如下,打印xps文件
var printers = new LocalPrintServer().GetPrintQueues();
var selectedPrinter = printers.FirstOrDefault(p => p.Name == Global.A4PrinterName);
var wpfPrint = new PrintDialog();
wpfPrint.PrintQueue = selectedPrinter;
PrintTicket pt = new PrintTicket();
pt.Duplexing = OKArg.Duplex;
pt.CopyCount = OKArg.printCount;
wpfPrint.PrintTicket = pt;
wpfPrint.PrintQueue.DefaultPrintTicket.Duplexing = OKArg.Duplex;
wpfPrint.PrintQueue.UserPrintTicket.Duplexing = OKArg.Duplex;
wpfPrint.PrintTicket.Duplexing = OKArg.Duplex;
wpfPrint.UserPageRangeEnabled = true;
wpfPrint.PageRangeSelection = PageRangeSelection.UserPages;
wpfPrint.PageRange = new PageRange(1,2);
wpfPrint.PrintDocument(doc.GetFixedDocumentSequence().DocumentPaginator, "文档打印");
为什么我设置的页面范围无效啊?实在只有三个财富值,不好意思~~ 展开
var printers = new LocalPrintServer().GetPrintQueues();
var selectedPrinter = printers.FirstOrDefault(p => p.Name == Global.A4PrinterName);
var wpfPrint = new PrintDialog();
wpfPrint.PrintQueue = selectedPrinter;
PrintTicket pt = new PrintTicket();
pt.Duplexing = OKArg.Duplex;
pt.CopyCount = OKArg.printCount;
wpfPrint.PrintTicket = pt;
wpfPrint.PrintQueue.DefaultPrintTicket.Duplexing = OKArg.Duplex;
wpfPrint.PrintQueue.UserPrintTicket.Duplexing = OKArg.Duplex;
wpfPrint.PrintTicket.Duplexing = OKArg.Duplex;
wpfPrint.UserPageRangeEnabled = true;
wpfPrint.PageRangeSelection = PageRangeSelection.UserPages;
wpfPrint.PageRange = new PageRange(1,2);
wpfPrint.PrintDocument(doc.GetFixedDocumentSequence().DocumentPaginator, "文档打印");
为什么我设置的页面范围无效啊?实在只有三个财富值,不好意思~~ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询