Prints specified pages from a PDF file. Use this tag to perform automated batch print jobs.
You can use the cfprint tag to print any PDF document, including those generated by the
cfdocument, cfpdf, and cfpdfform tag. Also, you can use this tag to print Report Builder
reports exported in PDF format.



This tag requires Adobe ColdFusion 8 and up.  Not supported on Lucee, etc.

Attribute Reference

source string

Source document to print. You can specify
one of the following:
An absolute or relative pathname to a PDF
document; for example,
c:\work\myPDF.pdf or myPDF.pdf. The
default directory is the template directory.
A PDF document variable in memory that
is generated by the cfdocument tag or the
cfpdf tag; for example, "myPDFdoc".

attributestruct string

ColdFusion structure used to specify
additional print instructions. Individually
named attributes take precedence over the
key-value pairs in the attribute structure.

copies string

Number of copies to print. The value must be
greater than or equal to 1.

jobname string

The name of a print job.

orientation string

Orientation of the page to be printed.
  • portrait
  • landscape
  • reverse-portrait
  • reverse-landscape

pages string

Pages in the source file to print. Duplicate
pages and pages beyond the total count of
pages in the document are ignored as long
as there is at least one page between 1 and
the total number of pages in the document.
You can combine individual page numbers
and page ranges; for example, 1-3,6,10-20.
If you do not specify a value for the pages
attribute, ColdFusion prints the entire

password string

Specifies either the owner or user password
for the PDF source file. If the PDF file is
password-protected, you must specify this
attribute for the file to print.

papersize string

Paper used for the print job. The value can be
any returned by the GetPrinterInfo
function. Valid
  • letter
  • legal
  • a4
  • a5
  • b4
  • b5
  • b4-jis
  • b5-jis

quality string

Print quality for the print job:

* draft
* high
* normal
  • normal
  • draft
  • high

color string

Color or monochrome printing

coverpage string

Specifies which job start and end sheets, if any, are printed with a job:

* none
* standard

type string

Specifies the file type of the document being
printed. PDF is the only valid value.
  • pdf

printer string

The name of a printer. An example in
Windows is \s1001prn02\NTN-2W-
HP_BW02. The default is the default printer
for the account where the ColdFusion server
is running.

sides string

  • duplex
  • one-sided
  • tumble
  • two-sided-long-edge
  • two-sided-short-edge

paper string

Paper used for the print job. The value can be any returned by the GetPrinterInfo function.
  • na-letter
  • na-legal
  • iso-a4
  • iso-a5
  • iso-b4
  • iso-b5
  • jis-b4
  • jis-b5

fidelity boolean
Default: false

Whether to print a job based on the print requirements specified. Valid values are:
* yes: if the job cannot be printed exactly as specified in the print requirements, the job is rejected.
* no: a reasonable attempt to print the job is acceptable

Sample code using the cfprint tag

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub