OpenOffice is an open-source office software that supports word processing, spreadsheets, presentations, and more. OpenOffice stores data in an international open standard format. See http://www.openoffice.org/ for details.

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

When you use cfdocument to convert a document file, the tag first checks for an OpenOffice installation. When the OpenOffice installation is found, the tag processes the rich text conversion through the OpenOffice libraries.

The cfdocument attributes, userPassword and permissions are used to open the converted PDF documents. For complete information about the cfdocument attributes that support OpenOffice document conversion, see the CFML Reference.

To install OpenOffice, see http://download.openoffice.org/index.html . See the ColdFusion Installation Guide for information about installing and configuring OpenOffice.

Example

The following example converts a document, MyDocument.doc, to a PDF file. The PDF conversion occurs only when you specify the format attribute as "pdf".

Note: When you convert, specify only the absolute path, for example, "c:\documents\MyDocument.doc"

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

Note: If you do not specify the filename attribute, the converted PDF opens in a browser.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy