Link to home
Start Free TrialLog in
Avatar of psenn
psenn

asked on

Convert Word to pdf from ColdFusion

Is there a ColdFusion method of converting a Word file into pdf?  I have to merge a Word document with a pdf, and I think I need to convert the Word document first so that I can use the cfpdf command to merge the two.
Avatar of _agx_
_agx_
Flag of United States of America image

Yes, you would need to convert the .doc to pdf first.  Unfortunately, there is not built in way to convert ms word documents.  You need an external tool.  I believe it can be done with LiveCycle (if you have that).  Otherwise, there are commercial tools available such as:

http://www.pdfonline.com/easypdf/sdk/faqs/using-bcl-easypdf-sdk.htm
pdf documents.  
www.aspose.com/documentation/file-format-components/aspose.pdf-for-.net...java/converting-word-documents-to-pdf.html
There are a bunch of tools out there, so a lot depends on your needs.  If it is a recurring need with a variety of complex word documents, complex, you would be better off with a commercial tool.  They tend to be more stable, but they are not free.

There are some free options like OpenOffice.  But the free options tend to have less documentation, and may not be able to handle everything you throw at them.   So you may want to take that into consideration.
ASKER CERTIFIED SOLUTION
Avatar of SidFishes
SidFishes
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, I was going to suggest that .. but I didn't think cfdocument understood MS Word's version of HTML.
http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_d-e_05.html#3765835
"The cfdocument tag does not support the Internet Explorer-specific HTML generated by Microsoft Word."

Well, supposedly it doesn't.  But you may as well give it a shot, and if it works great.  If not, nothing lost.
should edit my post... works with word 2000 (pre-mshtml)





Avatar of psenn
psenn

ASKER

Sid, I'm getting
ComObjectInstantiationException: An exception occurred when instantiating a COM object..

It's because it's a shared server I suppose.


<cfobject type="com" action="connect" class="Word.application" name="Application.MyWordobj" context="local">

Open in new window

wouldn't work on a shared sever at all (unless you could convince them to install an old copy of word 200 ..hehe)