How to convert Word and Excel documents to PDF programmatically?

為{幸葍}努か 提交于 2019-12-03 16:01:39

Office 2007 allows for this. I have found PDFCreator to be good, the VBA is included in sample files, and have heard that CutePDF is also good. PDFCreator and CutePDF are free.

To work without Office, you would need viewers, as far as I know: http://www.microsoft.com/downloads/details.aspx?FamilyID=c8378bf4-996c-4569-b547-75edbd03aaf0&displaylang=EN

http://www.microsoft.com/downloads/details.aspx?familyid=95E24C87-8732-48D5-8689-AB826E7B8FDF&displaylang=en

I needed to do this myself, but managed to get it done with .Net and without 3rd party tools:

MSDN: Saving Word 2007 Documents to PDF and XPS Formats

Pretty simple, about 50 lines of code. However I think you will need Word 2007 installed on the machine as well as the ability to Save As PDF

To convert Word documents to PDF, take a look at jWordConvert, a java library that can do exactly that. This will not work with the Excel files though, only with the Word files. The language is not Sharp, it's Java but you could switch to use IText (which is java) instead of ITextSharp.

The most common way to convert files to a pdf is to print them to print them to a pdf printer driver. There are a number of such drivers, one that i know of that will do the job is Black Ice.

Another is to use Adobe Acrobat's SDK. from memory its very expensive.

Its been a while since i have actually done any work with converting pdf's and the landscape may have changed.

Galwegian

You can also use a component like activePDF's DocConverter to convert a lot formats to PDF.

Use PDF maker that comes with adobe 7- 9

I just used this code Covert Doc to PDF

I'm surprised Aspose wasn't mentioned here, it's easy, simple, and reliable. Downside is that it is not free.

I've used iTextSharp in the past, it's really good, easy to install (one DLL I believe), the merge takes a bit of tindering so it's not as easy to use as Aspose, but hey, it's free so that is the best part.

prakash

TallPDF.NET (comes with a hefty price tag) allows you to serve dynamic PDF from any .NET application including ASP.NET pages and web services.

PDFEdit (free and open source) is an editor for manipulating PDF documents. It has a GUI version and a command-line interface. Scripting is used to a great extent in the editor and almost anything can be scripted. It is possible to create your own scripts or plugins.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!