在WPF C#应用程序中将XPS转换为PDF [英] Convert XPS to PDF in WPF C# application
问题描述
我需要将使用应用程序创建的XPS文件转换为PDF文件,这样做的最佳方法是什么?我更喜欢在C#内部使用托管程序集完成此操作.
I need to convert an XPS file I create with my application to a PDF file, what is the best way to do so? I prefer this to be done from inside C# using a managed assembly.
开源是第三方解决方案的首选
Open source is preferred upon third party solutions
推荐答案
您可以使用XpsDocument类读取XPS文件,然后使用PDF库(例如Report.Net或#PDF)将其导出.我在.NET 1.1中使用了#PDF,但不确定是否可以轻松地将其转换为.NET 2.0.
You can use the XpsDocument class to read the XPS files, then use a PDF library (such as Report.Net or #PDF) to export it. I used #PDF back in .NET 1.1, but not sure if it can be easily converted to .NET 2.0.
#PDF: http://sharppdf.sourceforge.net/
Report.NET: http://report.sourceforge.net/
Report.NET: http://report.sourceforge.net/
这篇关于在WPF C#应用程序中将XPS转换为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!