使用System.Drawing.Printing.PrintDocument生成在存储器中的PDF格式 [英] Use a System.Drawing.Printing.PrintDocument to generate a PDF in memory

查看:1661
本文介绍了使用System.Drawing.Printing.PrintDocument生成在存储器中的PDF格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道下面是可能的,如果有什么做它的最佳方式是免费的吗?

Does anyone know if the following is possible and if so what the best way of doing it is for free?

我生成一个项目,我目前工作的一个PrintDocument的,并显示打印对话框,用户可以选择他们想要使用等,目前是Windows窗体应用程序的打印机,如果用户想要打印到一个PDF,他们可以选择要打印到CutePDF或类似的东西。

I am generating a PrintDocument in a project I am currently working on and displaying a print dialog box so a user can choose which printer they want to use etc. The is currently a windows form application and if a user wants to print to a PDF they can select to print to CutePDF or something similar.

不过我现在穿着的应用ASP.Net web前端,并希望使用相同的code产生的PrintDocument但希望将其打印到PDF的飞行,并通过响应流服务起来在PDF文件下载的格式。

However I am now putting a ASP.Net web frontend on the application and want to use the same code to generate the PrintDocument but want to print it to a PDF on the fly and serve it up via the Response stream in the format of a PDF download.

所以我的问题是....我怎么可以使用当前的PrintDocument并从中产生内存中的PDF ??

So my question is....How can I use the current PrintDocument and generate a PDF in memory from it??

感谢

推荐答案

一的PrintDocument的System.Drawing中code可重复使用,以生成ABCpdf .NET的PDF文档。请参阅例如System.Drawing中...

The System.Drawing code for a PrintDocument can be reused to generate a PDF document with ABCpdf .NET. See the System.Drawing example...

这篇关于使用System.Drawing.Printing.PrintDocument生成在存储器中的PDF格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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