如何发送多个文档进行打印(作为printjob)? [英] How can I send multiple documents to print (As a printjob)?

查看:156
本文介绍了如何发送多个文档进行打印(作为printjob)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是一次只发送一个文件,而是需要发送多个

文件作为打印作业,因为我们的激光打印机只能堆叠而且

订购一个printjob它一次收到。

我需要使用以下代码:

PrinterSettings printerSettings = new PrinterSettings();

printerSettings.MaximumPage = m_numberOfPages;

printerSettings.MinimumPage = 1;

printerSettings.PrintRange = PrintRange.SomePages;

printerSettings.FromPage = 1;

printerSettings.ToPage = m_numberOfPages;

printerSettings.Copies = 3;

printerSettings.PrinterName = printerName;


PrintDocument pd = new PrintDocument();

m_currentPrintingPage = 1;

m_lastPrintingPage = m_numberOfPages;

pd.PrinterSettings = printerSettings;

pd.PrintPage + = new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

谢谢,

Tri nt

Instead of just sending one document at a time, I need to send multiple
documents as a print job because our laserprinter will only stack and
staple one printjob it receives at a time.
I need to use some of this code:
PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.Copies = 3;
printerSettings.PrinterName = printerName;

PrintDocument pd = new PrintDocument();
m_currentPrintingPage = 1;
m_lastPrintingPage = m_numberOfPages;
pd.PrinterSettings = printerSettings;
pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
pd.Print();
Thanks,
Trint

推荐答案

除非我弄错了,你需要把文件合并成一个

PrintDocument的。在.NET Framework中,PrintDocument表示单个

文档或单个打印作业。因为您正在使用PrintPage

事件,所以应该直接将HasMorePages属性

设置为true,直到您呈现了所有实际文档为止/>
想要合并到一个PrintDocument中。


Bruce Johnson [.NET MVP]
http://www.objectsharp.com/blogs/bruce


***通过开发人员指南 http://www.developersdex.com 发送***

不要只是参加USENET ......获得奖励!
Unless I''m mistaken, you need to combine the documents into a single
PrintDocument. In the .NET Framework, PrintDocument represents a single
document, or a single print job. Because you are using the PrintPage
event, it should be straight forward to keep the HasMorePages property
set to true until you have rendered all of the actual documents that you
want to combine in to a single PrintDocument.

Bruce Johnson [.NET MVP]
http://www.objectsharp.com/blogs/bruce

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


除非我弄错了,你需要把文件合并成一个

PrintDocument。在.NET Framework中,PrintDocument表示单个

文档或单个打印作业。因为您正在使用PrintPage

事件,所以应该直接将HasMorePages属性

设置为true,直到您呈现了所有实际文档为止/>
想要合并到一个PrintDocument中。


Bruce Johnson [.NET MVP]
http://www.objectsharp.com/blogs/bruce


***通过开发人员指南 http://www.developersdex.com 发送***

不要只是参加USENET ......获得奖励!
Unless I''m mistaken, you need to combine the documents into a single
PrintDocument. In the .NET Framework, PrintDocument represents a single
document, or a single print job. Because you are using the PrintPage
event, it should be straight forward to keep the HasMorePages property
set to true until you have rendered all of the actual documents that you
want to combine in to a single PrintDocument.

Bruce Johnson [.NET MVP]
http://www.objectsharp.com/blogs/bruce

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


不,HasMorePage * s仅用于打印第二页等等

打印的第一个文件(如果超出一页)。例如:

a多页发票...好吧,我想要3张发票(有些是多页,

已经由HasMorePage * s处理了)发送到

打印机作为printjob。相反,我只发送一份文件,而且它可能有多页,打印机上有:

pd.Print();

谢谢,

Trint

No, HasMorePage*s is just for printing the second or so-on pages of
the first document to print (if it goes beyond one page). For example:
a multi-page Invoice...ok, I want 3 invoices (some with multiple pages,
which is already being handled by HasMorePage*s) to be sent to the
printer as a printjob. Instead, I''m only sending one document, and it
may have multiple pages, to the printer with:
pd.Print();
Thanks,
Trint


这篇关于如何发送多个文档进行打印(作为printjob)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆