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?
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>
In CF8, you could probably do something with COM object integration or POI integration, but it would not be simple/straightforward.
Converting it to HTML using Word's save as feature is probably the simplest route using CF8. I'll suggest that Henry has the right idea, though, upgrading to CF9 to take advantage of OO.O integration.
Edit: Thanks to @jarofclay, I now know that the POI CFC wrapper has been updated to include Word docs. I remembered it only supporting Excel, but that's clearly changed. Um, is it too late for me to change my vote for how to do this in CF8?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With