简体   繁体   English

N页的PrintDocument N.

[英]PrintDocument N of N Pages

I am manually printing and drawing a document using this class but not sure how to be able to write on the document Page 1 of 10, Page 2 of 10 etc 我是使用这个类手动打印和绘制文档但不知道如何能够在文档上分别写入第1页,共10页,第2页,共10页等。

Any ideas? 有任何想法吗?

You have to count. 你必须要数。 use a class attribute in order to count. 使用class属性来计算。 Moreover you have to calc the total count. 此外,你必须计算总数。

Remember the printPage event is call for each page !! 记住printPage事件是为每个页面调用!!

http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.printpage.aspx http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.printpage.aspx

As far as I can tell, it will be necessary two printing passagens. 据我所知,这将是必要的两个印刷通道。 The first will simulate the printing process, while you count the pages. 第一个将模拟打印过程,同时计算页面。 On the second run you actually will send the output to the print device and now having the previously counted pages. 在第二次运行中,您实际上会将输出发送到打印设备,现在具有先前计算的页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM