将窗体应用程序导出为PDF(完全相同) [英] Exporting windows form app to PDF (exactly the same)

查看:259
本文介绍了将窗体应用程序导出为PDF(完全相同)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,这是我的第一篇文章,请原谅我可能出现的任何无知。

无论如何,我最近开始编码,我接受了一个学习项目来编写一个Windows窗体应用程序,在导出时,将转换为pdf文件。



截至目前,我已经使用itextsharp及其PdfPTable和PdfPCell组件成功实现了上述项目。



但是,我希望将我在visual studio中创建的表格完全导出为PDF,这意味着我不想以pdftable格式导出内容。



我不是要求确切的代码来实现我所要求的但是我只是想要一个方向,因为我仍然感到困惑和失去,即使阅读了很多相关的帖子。



谢谢,

Xiaonelly



我是什么尝试过:



我不是要求确切的代码来实现我的要求,但我只是想要一个方向,因为我仍然感到困惑和阅读完很多相关帖子之后就输了。

Hi guys, this is my first post, please pardon any ignorance i may present.
Anyway i've started coding recently and i took on a learning project to program a windows form app which upon exporting, will be converted to a pdf file.

As of now, I've already successfully achieved the above project using itextsharp and its PdfPTable and PdfPCell components.

However, i wish to export the form exactly as i created in visual studio to PDF, which means i do not want to export the contents in a pdftable format.

I am not asking for the exact code to achieve what I have asked but i simply ask for a direction as i am still confused and lost even after reading through many relevant posts.

thanks,
Xiaonelly

What I have tried:

I am not asking for the exact code to achieve what I have asked but i simply ask for a direction as i am still confused and lost even after reading through many relevant posts.

推荐答案



首先让我解释一下我对你想要达到的目标的理解。您想将winform导出为PDF,对吧?如果是这样,那么您将有几个选项,但大多数选项都需要一个将流(内存中的信息)转换为PDF文件的组件。一种非常简单的方法是打印winform并选择PDF打印机(可以从互联网上轻松安装)作为打印机。通过这种方式,您实际上将问题的范围更改为更容易解决的问题。如何打印winform?对于这个新问题,它最终将提供一个很好的解决方案来解决原始问题(如何将winform导出为PDF),您可以使用以前与其他人讨论过的解决方案,并且他们接受了解决方案:



来自CodeProject:

Print-Windows-form-in-Csharp-net



来自Stack Overflow:

< a href =https://stackoverflow.com/questions/4813341/convert-windows-form-to-pdf-file> c# - 将Windows窗体转换为pdf文件 - Stack Overflow



如果这不能解决您的问题,请发表评论,我会帮助您改进我的解决方案,直到您的问题得到解决。



干杯,

AH
Hi,
So first let me explain my understanding of what you want to achieve. You would like to export your winform to PDF as it is, Right? If so, then you will have several options but most of them will require a component that converts stream (information in memory) into a PDF file. A very easy way would be printing the winform and selecting a PDF printer (which you can easily install one from the internet) as the printer. In this way, you are in fact changing the scope of the problem to a problem which is more easy to solve. How to print a winform? For this new problem which will at the end provide a nice solution to solve the original problem as well (how to export winform into PDF) you have the below solutions that have been discussed with others before, and they accepted the solutions:

From CodeProject:
Print-Windows-form-in-Csharp-Net

From Stack Overflow:
c# - convert windows form to pdf file - Stack Overflow

If this did not solve your problem then please leave a comment and I will assist you by improving my solution until your problem gets solved.

Cheers,
AH


这篇关于将窗体应用程序导出为PDF(完全相同)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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