转换MS Word文档为PDF在ASP.NET [英] Converting MS Word Documents to PDF in ASP.NET

查看:130
本文介绍了转换MS Word文档为PDF在ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似的问题已经被问过,但没有完全像我的,所以这里去。

Similar questions have been asked, but nothing exactly like mine, so here goes.

我们有合并域的值被填写为用户表单提交的结果的ASP.NET Web服务器上的Microsoft Word文档的集合。现场合并后,服务器必须将文档转换为PDF和流下来的浏览器。我们的第一个倾向是使用了Office API的Visual Studio工具;但是,我们遇到了微软这样的警告:

We have a collection of Microsoft Word documents on an ASP.NET web server with merge fields whose values are filled in as a result of user form submissions. After the field merge, the server must convert the document to PDF and stream it down to the browser. Our first inclination was to use the Visual Studio Tools for Office API; however, we ran into this warning from Microsoft:

微软目前并不提倡,不支持,Microsoft Office应用程序的自动化,从任何无人参与的非交互式客户端应用程序或组件(包括ASP,ASP.NET,DCOM和NT服务),因为Office可能会出现不稳定当Office在这种环境中运行的行为和/或死锁。

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

它看起来像场操作可以使用的Open XML SDK 做,但什么是最好的方式来转换Word 2007文档为PDF格式,而无需打开Word中?最佳的解决办法是低成本,可扩展,具有低内存占用,易于部署,并且有.NET API。

It looks like the field manipulation can be done using the Open XML SDK, but what's the best way to convert Word 2007 documents to PDF without opening Word? The optimal solution would be low-cost, scalable, have a low memory footprint, be easy to deploy, and have a .NET API.

推荐答案

这不完全开源,但阅读Aspose有几个产品,能做到这一点,

It's not exactly Open Source, but Aspose has a couple products which can do that,

<一个href=\"http://www.aspose.com/categories/file-format-components/aspose.pdf.kit-for-.net-and-java/default.aspx\">Aspose.Pdf.Kit

Aspose.Pdf.Kit是一个非图形PDF®文档处理组件,它使.NET和Java开发人员来管理现有的PDF文件以及管理嵌入PDF文件中的表单域。 Aspose.Pdf是完美的创造新的PDF文件;但是,开发人员经常需要修改已经存在的PDF文档。 Aspose.Pdf.Kit使他们能够做到这一点。 Aspose.Pdf.Kit允许开发者直接将数据合并成PDF文档,以及更新和管理PDF文档创建功能强大的应用程序。 Aspose.Pdf.Kit是一个美妙的产品,并与我们的PDF产品,其余的伟大工程。

Aspose.Pdf.Kit is a non-graphical PDF® document manipulation component that enables both .NET and Java developers to manage existing PDF files as well as manage form fields embedded within PDF files. Aspose.Pdf is perfect for creating new PDF files; however, developers often need to edit already existing PDF documents. Aspose.Pdf.Kit allows them to do just that. Aspose.Pdf.Kit allows developers to create powerful applications for merging data directly into PDF documents as well as for updating and managing PDF documents. Aspose.Pdf.Kit is a wonderful product and works great with the rest of our PDF products.

和<一个href=\"http://www.aspose.com/categories/file-format-components/aspose.pdf-for-.net-and-java/default.aspx\">Aspose.pdf

Aspose.Pdf是一个非图形PDF®文档报表组件,可以让任何.NET或Java应用程序,而无需使用的AdobeACROBAT®从头开始创建PDF文档。 Aspose.Pdf非常经济实惠的价格,并提供了丰富强大的功能,包括:COM pression,表格,图形,图像,超链接,安全和自定义字体。 Aspose.Pdf支持通过API的PDF文件,XML模板和XSL-FO文件的创建。 Aspose.Pdf非常易于使用,并且提供了14写在C#和Visual Basic全功能的演示。

Aspose.Pdf is a non-graphical PDF® document reporting component that enables either .NET or Java applications to create PDF documents from scratch without utilizing Adobe Acrobat®. Aspose.Pdf is very affordably priced and offers a wealth of strong features including: compression, tables, graphs, images, hyperlinks, security and custom fonts. Aspose.Pdf supports the creation of PDF files through API, XML templates and XSL-FO files. Aspose.Pdf is very easy to use and is provided with 14 fully featured demos written in both C# and Visual Basic.

退房的<一个href=\"http://www.aspose.com/documentation/file-format-components/aspose.pdf-for-.net-and-java/aspose.pdf-for-.net-api-reference.htm\">API和演示的。你可以下载一个DLL免费尝试一下。我用两个前,他们执行的很好。

Check out the API and demos. You can download a DLL for free to try it out. I've used both before and they work out great.

还有 iTextSharp的这是iText的,一个Java PDF转换器的C#端口。我听说过一些人,结果好坏参半尝试。

There's also iTextSharp which is a C# port of iText, a Java PDF converter. I've heard some people try it with mixed results.

这篇关于转换MS Word文档为PDF在ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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