Skip to main content
Inspiring
August 6, 2010
Question

Saving/exporting a Word (2000) doc as a PDF

  • August 6, 2010
  • 1 reply
  • 982 views

Hi,

I ran into a problem attempting to save a Word doc as a PDF.

Here's the details:

// get the doc content into a cf var
<cffile action="read" file="xyz.doc" variable="mydoc"/>

// use cfdocument to save the var as a pdf doc
<cfdocument filename="myPDF.pdf" format="pdf" mimeType="application/msword">
<cfoutput>#mydoc#</cfoutput>
</cfdocument>

The generated pdf file looks minimized and crammed, some of its
content is sort of legible, the original Word doc (2000) is of 45k.  What's happening?

Is there another way to do it?

Thanks in advance.

This topic has been closed for replies.

1 reply

Inspiring
August 6, 2010

I am surprised anything is legible.

On CF8 and earlier, cfdocument can convert html/cfml code to pdf. It cannot convert binary Office documents.

CF9 is capable of converting supported Office documents with the help of the "srcfile" attribute and OpenOffice

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS692D73AF-6338-495d-9E47-C2ECD8BF9307.html

Message was edited by: -==cfSearching==-

Inspiring
August 6, 2010

Very informative.  Thank you.