Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 947

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
myBook_page_1.jpg
myBook_page_2.jpg
myBook_page_3.jpg
...
myBook_page_100.jpg
If you specify a destination, ColdFusion does not create the thumbnails directory and stores the files in the specified
directory instead. The following code generates a thumbnail image called myBook_page_1.jpg from the first page of
myBook.pdf and stores it in a directory called images, which is relative to the CFM page:
<cfpdf action="thumbnail" source="myBook.pdf" pages="1" destination="images">
You change the prefix for the thumbnail filename and the change image file format to PNG or TIFF by specifying the
and
attributes. The following code generates a file called TOC_page_2.PNG from the second
imagePrefix
format
page of myBook.pdf:
<cfpdf action="thumbnail" source="myBook.pdf" pages="2" imagePrefix="TOC" format="PNG"
destination="images">
The following code generates thumbnails from a range of pages and changes the image background to transparent (the
default is opaque):
<cfpdf action="thumbnail" source="myBook.pdf" pages="1-10,15,8-16,59" transparent="yes"
destination="\myBook\subset" imagePrefix="abridged">
For an example of how to generate thumbnail images and link them to pages in the source PDF document, see the cfpdf
tag in the CFML Reference.
ColdFusion 9 release has introduced some new attributes for the thumbnail action:
: You can set this attribute to true to extract high resolution images from the page. If a document contains
hires
high resolution images and you want to retain the resolution of the images, then this attribute is useful.
For example:
<cfpdf action="thumbnail" source="./WORK/myBook.pdf" destination="./WORK/Testing_CFPDF"
overwrite="true" hires="yes">
: If you set this attribute to true, the thumbnail generated does not adhere to the PDF page size, but
overridepage
to the image size that is present in that page. If the image is not present, the size is set to the maximum size of the page.
: Use this attribute to compress the size of the thumbnail images. As the name of the attribute
compresstiffs
suggests, it is only valid for the TIFF format. Following is an example:
<cfpdf action="thumbnail" source="C:\WORK\myBook.pdf" destination="C:\WORK\Testing_CFPDF"
overwrite="true" hires="yes" format="tiff" compresstiffs="yes">
: Use this attribute to specify an integer value for the maximum scale of the thumbnail images.
maxscale
: Use this attribute to specify an integer value of the maximum length of the thumbnail images.
maxlength
: Use this attribute to specify an integer value of the maximum width of the thumbnail.
maxbreadth
The following example illustrates the use of maxscale, maxlength, and maxbreadth:
<cfpdf action="thumbnail" source="./WORK/myBook.pdf" destination="./WORK/Testing_CFPDF"
overwrite="true" format="jpg" maxscale="3" maxlength="300" maxbreadth="200" hires="yes"
scale="100">
Note: Typically, the value of the
attribute is set to '100' when using the
scale
Last updated 1/20/2012
attribute.
maxscale
942

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents