Can I convert a Microsoft Word document to PDF using ColdFusion?

The above question says it all. I know that you can create a PDF file from an image or HTML file in ColdFusion 8 using CFPDF, but I am wondering if it is possible to create a PDF document from an MS Word document directly - in CF8 or CF9.

Could you import a Word document and convert it to HTML or image file and then do the conversion? Or is there a shortcut?

+6
coldfusion ms-word pdf pdf-generation cfpdf
source share
3 answers

see Doc: Office File Compatibility - Using cfdocument

ColdFusion 9 supports OpenOffice , which uses the cfdocument tag to convert a Word document (.doc format) to PDF.

 <cfdocument format="pdf" srcfile="C:\documents\MyDocument.doc" filename="C:\documents\MyDocument.pdf"> </cfdocument> 
+7
source share

In CF8, you could probably do something with integrating COM objects or integrating POIs, but that would not be easy / straightforward.

Converting it to HTML using the Word save function as perhaps the easiest way using CF8. I guess Henry has the right idea, however, to switch to CF9 in order to use OO.O integration.

Edit: Thanks to @jarofclay, I now know that the CFC POI wrapper has been updated to include Word documents. I remember that it only supported Excel, but that has clearly changed. Um, is it too late for me to change my vote on how to do this in CF8?

+5
source share

I am not familiar with CF at all, but if you can make web service calls from it, try this product . It relies on MS-Office rather than Open Office, and therefore provides much better conversion accuracy. It also supports additional formats, including Infopath, Excel, PowerPoint, etc., as well as support for watermarks .

Please note that I have been working on this product, so the usual disclaimers apply.

0
source share

All Articles