
889
Las
t
upda
te
d 8/5/2010
Chapter 11: Office file interoperability
Adobe ColdFusion provides interfaces to work with PDF, Adobe Flash, and Adobe Connect. ColdFusion 9 now
extends the integration support to OpenOffice and Microsoft Office application formats such as Excel, PowerPoint,
and SharePoint.
Office interoperability supports both OpenOffice and Apache POI libraries (see
http://poi.apache.org/
for information
on Apache POI). OpenOffice libraries support conversion of all Office file formats, including Word documents to
PDF. When you use the
cfdocument
,
cfpresentation
, or
cfspreadsheet
tags to convert Office files, the tags first
search for an OpenOffice installation.
If an OpenOffice installation is not found, POI libraries are used. POI libraries support conversion of all office files
except Word documents.
See “
Supported Office conversion formats
” on page 893 for the complete list of supported Office conversion formats.
Using cfdocument
In addition to the existing functionality, the
cfdocument
tag lets you convert Word documents and PowerPoint
presentations to PDF. All versions of Microsoft Word and Microsoft PowerPoint from 97 to 2003 are supported.
Working with documents using OpenOffice
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 9 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 9 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.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...