Search code examples
pdfcoldfusionms-wordpdf-generationcfpdf

Is it possible to convert a Microsoft Word document to PDF with ColdFusion?


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

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


Solution

  • see Doc: Office file interoperability - 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>