使用 PrintVisual() 打印多个窗口
我目前正在 wpf 应用程序中使用 PrintVisual()
进行打印。目前这工作得很好,我现在遇到的唯一问题是在处理需要分页的大量数据时,我想将窗口多次渲染到缓冲区,然后执行打印作业。目前 PrintVisual()
创建多个打印作业,这可以工作,但不是很雄辩。
我尝试使用反射器获取 PrintVisual()
的源代码,希望将其实现到 IDocumentPaginatorSource
中,不幸的是反射器失败了。
也许我应该尝试将窗口渲染为 FlowDocument ?尽管我不太热衷于对打印布局进行编码。
有什么建议吗? 提前致谢!
I'm currently using PrintVisual()
in a wpf application to do printing. This is working perfectly at the moment, the only issue I now have is when processing large amounts of data I need to paginate, whereby I want to render the window multiple times to a buffer and then execute a print job. Currently PrintVisual()
creates multiple print jobs, which works, but is not very eloquent.
I have attempted to use reflector to get the source for PrintVisual()
in hopes of implementing that into an IDocumentPaginatorSource
, unfortunately reflector is failing.
Perhaps I should try rending the window to a FlowDocument
? Although I'm not too keen on having to code the printing layout.
Any suggestions?
Thanks In Advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过在每个页面的画布上调用
RenderTargetBitmap()
来实现这一点。I came right by calling
RenderTargetBitmap()
on each page's canvas.