关于WPF打印的问题

时间:2023-02-28 12:56:41


我曾在此文中提到过WPF中的文档打印

有朋友来信问了这样一个问题:
发现 在WPF上做打印功能,只能限制在XPS上面,如果是个XPS格式的文档,那还行,有些文件原先不是XPS 格式的,比喻.doc, .pdf等等,难道要去手动把它们变成XPS 格式的吗? 那要程序干什么! 这几天一直在研究,搞不定,网上关于WPF的资料又少,请教大侠有什么好的思路,给小弟参考参考….
 
》》
You can see these urls:
​​​http://www.charlespetzold.com/blog/2006/02/201111.html​

​http://www.charlespetzold.com/blog/2006/02/230940.html​​​
​​​http://msdn2.microsoft.com/en-us/library/ms742418.aspx​

And ​the Printing Overview section in the SDK​​. Printing in WPF is definitely the easiest it's ever been on any Microsoft platform. PrintPageEventArgs and the rest of the System.Drawing.Printing API is a thing of the past. For the quick start, just ​have a look at PrintDialog​​. The easiest thing to do is just hand it your on screen UI element that you want printed, via ​PrintVisual​​, and let it do the rest.
 
​​​http://msdn2.microsoft.com/en-us/library/aa969772.aspx​​​​http://msdn2.microsoft.com/en-us/library/ms771525.aspx​​​
If you want print other files which like .doc, .pdf, you can use another software such as Word, Acrobt and so on. If you want print in you programe, you can call windows print APIs or 3rd Plug-In.

100% .NET component for rendering PDF documents: ​​http://www.codeproject.com/showcase/pdfrasterizer.asp?print=true​