是否有任何将XPS转换为PDF的开放工具? [英] Is ther any open tool to convert XPS to PDF?

查看:79
本文介绍了是否有任何将XPS转换为PDF的开放工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了很多工作,以找出将 XPS 文档转换为 PDF 的简便方法.有许多工具可以做到这一点,但它们并非免费的.有免费的替代品吗?

I did a lot of digging to figure out an easy way to convert an XPS document into a PDF. There are many tools that can do this but they are not free. Is there a free alternative?

推荐答案

一个快速的Google搜索使我想到了:

A quick google search led me to this: http://www.nathanpjones.com/wp/2013/03/output-to-pdf-in-wpf-for-free/

在我剪掉一些不需要的代码后,我能够使它工作.结果如下:

I was able to get it to work after I trimmed down some of the code I did not need. Here is the result:

using (PdfSharp.Xps.XpsModel.XpsDocument pdfXpsDoc = PdfSharp.Xps.XpsModel.XpsDocument.Open(xpsPath))
{
    PdfSharp.Xps.XpsConverter.Convert(pdfXpsDoc, pdfPath, 0);
}

2个路径变量只是字符串.

The 2 path variables are just strings.

您需要引用以下两个dll: http://www.nathanpjones.com/wp/wp-content/uploads/2013/03/PdfSharpXpsBin.zip

You need to reference these 2 dll's: http://www.nathanpjones.com/wp/wp-content/uploads/2013/03/PdfSharpXpsBin.zip

非常感谢Nathan共享此信息!

Many thanks to Nathan for sharing this information!

内森作品以NuGet包的形式提供这里.

Nathan work is available as a NuGet package here.

这篇关于是否有任何将XPS转换为PDF的开放工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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