wpf 将 XPS 转换为 PDF(反之亦然)的最佳方法?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1002476/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Best ways to convert XPS to PDF (and vice-versa)?
提问by markti
I have XPS documents being generated from XAML User Controls that act as templates. I want to convert the XPS documents into alternative formats, mainly PDF, programmatically with a .NET based API.
我有从充当模板的 XAML 用户控件生成的 XPS 文档。我想使用基于 .NET 的 API 以编程方式将 XPS 文档转换为替代格式,主要是 PDF。
What is the best way to do this?
做这个的最好方式是什么?
采纳答案by markti
回答by markti
You can also use ABCpdf PDF Component for .NET . Version 7 can serve your purpose. see http://www.websupergoo.com/abcpdf-12.htm.
您还可以将 ABCpdf PDF 组件用于 .NET。版本 7 可以满足您的目的。见http://www.websupergoo.com/abcpdf-12.htm。
it provides fully functional trial version unlike NiXPS and almost equally as fast as NiXPS.
它提供与 NiXPS 不同的全功能试用版,并且几乎与 NiXPS 一样快。
回答by northpole
The way I have done this in the past is print my XPS file to a PDF printer. I use cutePDFfor this. So when you select to print, you print to cutePDF which prints a PDF version.
我过去这样做的方法是将我的 XPS 文件打印到 PDF 打印机。我为此使用cutePDF。因此,当您选择打印时,您将打印到可打印 PDF 版本的 cutPDF。
I am not sure if this will meet your needs but it has worked well for me in the past.
我不确定这是否能满足您的需求,但过去对我来说效果很好。
回答by Brian
If you have OneNote, you can print to OneNote and then export as PDF at least in OneNote 2013. This seems better than having to install another third party tool.
如果你有 OneNote,你可以打印到 OneNote,然后至少在 OneNote 2013 中导出为 PDF。这似乎比必须安装另一个第三方工具更好。
回答by CaffeineToCode
If you want to do this in your own program, CloudConvert has a free and open source API built on the .NET framework by MadScripter.
如果您想在自己的程序中执行此操作,CloudConvert 有一个由 MadScripter 在 .NET 框架上构建的免费开源 API。