使用PrintDocument打印Docx,Pdf文件 [英] Print Docx,Pdf file with PrintDocument

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

问题描述



如何使用asp.net web应用程序中的PrintDocument打印任何文档,pdf文件

Hi,
How we can print any docs ,pdf file with the PrintDocument in asp.net web application

推荐答案

PrintDocument can打印任何你可以使用System.Drawing.Graphics类绘制的东西,遗憾的是,它不支持PDF,也不支持Docx等,只是简单的元素,如线条,rects,椭圆,文本和图像。如果要将doc,pdf等打印到客户端打印机,您可以让用户下载文档并手动打印或尝试此代码但它要求客户安装Word for doc,Adobe Reader for PDF +其他工具。
PrintDocument can print anything you can "draw" using System.Drawing.Graphics class which sadly, it does not support PDF, nor Docx, etc but just simple elements like lines, rects, ellipses, text and images. If you want to print doc, pdf, etc to the client printer you can just let the user to download the document and print it "manually" or try this code BUT it requires the client to have installed Word for doc, Adobe Reader for PDF + another tool.


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

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