<cfpdf>

Manipulates existing PDF documents.

The following list describes some of the tasks you can perform with the cfpdf tag:

  • Merge several PDF documents into one PDF document.
  • Delete pages from a PDF document.
  • Merge pages from one or more PDF documents and generate a new PDF document.
  • Linearize PDF documents for faster web display.
  • Remove interactivity from forms created in Acrobat(c) to generate flat PDF documents.
  • Encrypt and add password protection to PDF documents.
  • Generate thumbnail images from PDF documents or pages.
  • Add or remove watermarks from PDF documents or pages.
  • Retrieve information associated with a PDF document, such as the software used to generate the file or the author, and set information for a PDF document, such as the title, author and keywords.
  • Create PDF portfolios
  • Add and remove header/footer from PDF documents
  • Optimize PDF documents

This tag may have a body.

This tag is also supported within <cfscript>

Attribute Description
copyfrom
any, optional

Pathname of the PDF document from which to use the first page as a watermark

bottommargin
numeric, optional

bottom margin of the text in footer

align
string, optional

Aligns the header and footer in PDF:

  • left
  • right
  • center
permissions
string, optional

type of permissions on the PDF document

info
struct, optional

Structure variable for relevant information

newuserpassword
string, optional

Password used to open PDF document

pages
string, optional

Page or pages in the source PDF document on which to perform the action. You can specify multiple pages and page ranges as follows: "1,6-9,56-89,100, 110-120".

ddxfile
string, optional

Pathname of the DDX file, or a string with DDX instructions

topmargin
numeric, optional

top margin of the text in header

showonprint
boolean, optional

Specify whether to print the watermark with the PDF document

password
string, optional

Owner or user password of the source PDF document, if the document is password-protected.

isbase64
boolean, optional

Valid only when the image attribute is specified. Specifies whether the image used as a watermark is in Base64 format

leftmargin
numeric, optional

left margin of the text in header/footer

name
string, optional

PDF document variable name

numberformat
string, optional

Specify the numbering format for PDF pages in the header/footer. possible values are:

  • LOWERCASEROMAN
  • UPPERCASEROMAN
  • NUMERIC
encrypt
string, optional

Encryption type for the PDF output file

destination
string, optional

Pathname of the modified PDF document. If the destination file exists, you must set the overwrite attribute to yes. If the destination file does not exist, CFML creates the file, if the parent directory exists.

stoponerror
boolean, optional

Valid only if the directory attribute is specified. If the specified directory contains files other then readable PDF files, Lucee either stops merge process or continues.

opacity
number, optional

Opacity of the watermark. Valid values are integers in the range 0 (transparent) through 10 (opaque).

format
string, optional

File type of thumbnail image output

rightmargin
numeric, optional

right margin of the text in header/footer

text
string, optional

text for header or footer, you can add he following place holders within the text:

  • _PAGELABEL: add current page label
  • _LASTPAGELABEL: add last page label
  • _PAGENUMBER: add current page number
  • _LASTPAGENUMBER: add last page number
transparent
boolean, optional

(format="png" only) Specifies whether the image background is transparent or opaque

position
string, optional

Position on the page where the watermark is placed. The position represents the top-left corner of the watermark. Specify the x and y coordinates; for example "50,30".

inputfiles
struct, optional

Structure that maps the PDF source files to the input variables in the DDX file, or a string of elements and their pathname.

source
any, optional

PDF document used as the source.

version
number, optional

Version of the PDF used to write the document

filter
string, optional

file filter, used with attribute directory

directory
string, optional

Directory of the PDF documents to merge. You must specify either the directory attribute or the source attribute. If you specify the directory attribute, CFML orders the documents by filename in descending order, by default. To change the order of the files, use the order attribute.

imageprefix
string, optional

prefix used for each image thumbnail file generated. The image filenames use the format: imagePrefix_page_n.format.

saveoption
string, optional

Save options for the PDF output

order
string, optional

Order in which the PDF documents in the directory are merged

outputfiles
struct, optional

Structure that contains the output files in the DDX file or string as keys and the pathname to the result file as the value.

scale
number, optional

Size of the thumbnail relative to the source page. The value represents a percentage from 1 through 100.

newownerpassword
string, optional

Password used to set permissions on a PDF document

resolution
string, optional

Image quality used to generate thumbnail images

flatten
boolean, optional

Applies to forms created in Acrobat only (not forms created in LiveCycle); specifies whether interactivity is turned off

image
any, optional

Image used as a watermark. You can specify a pathname, a variable that contains an image file, or an image variable

foreground
boolean, optional

Placement of the watermark on the page

type
string, optional

used for action "extractText", defines the format type of the extraction, valid values are: string,xml

overwrite
boolean, optional

Specifies whether PDF output overwrites the destination file

action
string, optional

action to take

rotation
number, optional

Degree of rotation of the watermark image on the page.

ascending
boolean, optional

Order in which the PDF files are sorted

keepbookmark
boolean, optional

Specifies whether bookmarks from the source PDF documents are retained in the merged document

<cfpdf
    [copyfrom=any]
    [bottommargin=numeric]
    [align=left|right|center]
    [permissions=string]
    [info=struct]
    [newuserpassword=string]
    [pages=string]
    [ddxfile=string]
    [topmargin=numeric]
    [showonprint=boolean]
    [password=string]
    [isbase64=boolean]
    [leftmargin=numeric]
    [name=string]
    [numberformat=NUMERIC|LOWERCASEROMAN|UPPERCASEROMAN]
    [encrypt=string]
    [destination=string]
    [stoponerror=boolean]
    [opacity=number]
    [format=string]
    [rightmargin=numeric]
    [text=string]
    [transparent=boolean]
    [position=string]
    [inputfiles=struct]
    [source=any]
    [version=number]
    [filter=string]
    [directory=string]
    [imageprefix=string]
    [saveoption=string]
    [order=string]
    [outputfiles=struct]
    [scale=number]
    [newownerpassword=string]
    [resolution=string]
    [flatten=boolean]
    [image=any]
    [foreground=boolean]
    [type=string]
    [overwrite=boolean]
    [action=addWatermark|deletePages|getInfo|merge|protect|read|removeWatermark|setInfo|thumbnail|write]
    [rotation=number]
    [ascending=boolean]
    [keepbookmark=boolean]
><!--- body --->[</cfpdf>]

Examples

There are currently no examples for this tag.

See also