cfprint

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.

 <cfprint>

 cfprint();

This tag requires Adobe ColdFusion. Not supported on Lucee, OpenBD, etc.

cfprint Attribute Reference

source

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

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

copies

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

jobname

The name of a print job.

orientation

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

pages

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
document.

password

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

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

quality

Print quality for the print job:

* draft
* high
* normal Values:
  • normal
  • draft
  • high

color

Color or monochrome printing

coverpage

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

* none
* standard

type

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

printer

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

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

paper

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

fidelity
Default: NO

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

Fork me on GitHub