打印多页在WPF [英] Print Multipage in WPF

查看:467
本文介绍了打印多页在WPF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要印我的形式,但它是大的只有一个页面输入,所以我需要在2页打印,我可怜的知识,让我知道如何打印一页,但热点如何在多页打印。 你有什么建议我怎么能在多打印,所有形式的帮助将是AP preciate。

i have to print my form but it is big to enter in only one page so i need to print it in 2 pages ,my poor knowledge allow me to know how print one page but hot how print in multipage . Do you have any advice how i can print in multipage,all kind of help will be appreciate.

感谢。

好工作

推荐答案

您需要重写的 DocumentPaginator 类。

博客帖子帮我弄它的工作。

我所做的就是创建一个用户控件,将显示一个数据页的(任何页面)的价值。

What I did was create a UserControl that would show one page's (any of the pages) worth of data.

然后在覆盖了 GetPage中我创建了用户控件(传递给它的页码来渲染),然后测量并安排它(使用每页 DocumentPaginator ),并返回它作为一个 DocumentPage (将它传递给的构造函数 DocumentPage )。

Then in the override for GetPage I created the UserControl (passing it the page number to render), then measured and arranged it (using the PageSize from the DocumentPaginator), and returned it as a DocumentPage (by passing it to the constructor of DocumentPage).

然后,你需要重写 PageCount 每页,这样当每页更新时, PageCount 被改变。

Then you need to override PageCount and PageSize, so that when PageSize is updated, the PageCount is changed.

这篇关于打印多页在WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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