从WPF窗口内容生成PDF [英] PDF Generation from WPF window content

查看:542
本文介绍了从WPF窗口内容生成PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在开发wpf应用程序....在我的应用程序中,我有计费部分......在生成帐单之后,我想将该帐单的总体视图放入pdf文件...这个计费部分包含多个DataGrids ...是否有任何函数通过捕获屏幕的完整视图来生成PDF ...或者我们应该通过代码设计PDF格式的网格??? ...请帮助我...如果没有用于捕获视图的内置函数...那么请通过提供示例代码来帮助我,以便在pdf中设计数据网格并生成它....我对这个pdf生成感到震惊......请帮助我...

Hello,
I am working on wpf application.... In my application I have billing section ... After the bill generation I want to place that total view of the bill into a pdf file... This Billing Section contains multiple DataGrids... Is there any function to generate a pdf by capturing the complete view of the screen... Or should we design the grids in pdf through code???... Please help me...In case if there is no built in function for capturing view...Then please help me out by giving sample code for desigining datagrids in pdf and generating it.... i am strucked at this pdf generation... Please help me...

推荐答案

要生成PDF,您可以使用iText或其.NET端口,iTextSharp:

http://en.wikipedia.org/wiki/IText [ ^ ],

http:/ /itextpdf.com/ [<一个href =http://itextpdf.com/target =_ blanktitle =New Window> ^ ],

http://sourceforge.net/projects/itextsharp/ [ ^ ]。



包括对Java iText网站的引用,因为大多数文档都在那里。如果您了解C#,那么理解基于Java的API文档并不困难。



生成不是来自UI而是来自数据模型的文档总是更好,但是然后你必须有适当的应用程序架构。



-SA
To generate PDF, you can use iText, or its .NET port, iTextSharp:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^].

In included the reference to Java iText site as well, because most documentation is there. If you understand C#, it would not be difficult to understand Java-bases API documentation.

It's always better to generate documents not from UI but from your data model, but then you have to have appropriate application architecture.

—SA


这篇关于从WPF窗口内容生成PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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