Tags · Functions · Objects
Lucee Tag Reference
Choose a tag:

Tag <CFDOCUMENT>

Creates a PDF document from a text block containing CFML and HTML.

Body

This tag may have a body.

Example

	<cfdocument
		[authpassword="string"]
		[authuser="string"]
		[backgroundvisible="boolean"]
		[bookmark="boolean"]
		[encryption="String"]
		[filename="String"]
		[fontembed="string"]
		[format="string"]
		[htmlbookmark="boolean"]
		[localurl="boolean"]
		[marginbottom="number"]
		[marginleft="number"]
		[marginright="number"]
		[margintop="number"]
		[mimetype="string"]
		[name="string"]
		[orientation="string"]
		[overwrite="boolean"]
		[ownerpassword="string"]
		[pageheight="number"]
		[pagetype="string"]
		[pagewidth="number"]
		[permissions="string"]
		[proxyhost="string"]
		[proxypassword="string"]
		[proxyport="number"]
		[proxyuser="string"]
		[saveasname="string"]
		[scale="number"]
		[src="string"]
		[srcfile="string"]
		[unit="string"]
		[useragent="string"]
		[userpassword="string"]>

	[</cfdocument>]
	
This tag is also supported within cfscript
	<cfscript>
		document
		[authpassword="string"]
		[authuser="string"]
		[backgroundvisible="boolean"]
		[bookmark="boolean"]
		[encryption="String"]
		[filename="String"]
		[fontembed="string"]
		[format="string"]
		[htmlbookmark="boolean"]
		[localurl="boolean"]
		[marginbottom="number"]
		[marginleft="number"]
		[marginright="number"]
		[margintop="number"]
		[mimetype="string"]
		[name="string"]
		[orientation="string"]
		[overwrite="boolean"]
		[ownerpassword="string"]
		[pageheight="number"]
		[pagetype="string"]
		[pagewidth="number"]
		[permissions="string"]
		[proxyhost="string"]
		[proxypassword="string"]
		[proxyport="number"]
		[proxyuser="string"]
		[saveasname="string"]
		[scale="number"]
		[src="string"]
		[srcfile="string"]
		[unit="string"]
		[useragent="string"]
		[userpassword="string"] {

	}
	</cfscript>

Attributes

The attributes for this tag are fixed. Except for the following attributes no other attributes are allowed.
Name Type Required Description
authpassword string No Password sent to the target URL for Basic Authentication. Combined with username to form a base64 encoded string that is passed in the Authenticate header. Does not provide support for Integrated Windows, NTLM, or Kerberos authentication. 
authuser string No User name sent to the target URL for Basic Authentication. Combined with password to form a base64 encoded string that is passed in the Authenticate header. Does not provide support for Integrated Windows, NTLM, or Kerberos authentication. 
backgroundvisible boolean No Specifies whether the background prints when the user prints the document 
bookmark boolean No Specifies whether bookmarks are created in the document 
encryption String No define if the output should be encrypted and how deep 
filename String No name for output file, if not defined output will be written to response stream 
fontembed string No define if fonts will embedded with the file 
format string No format of the created file 
htmlbookmark boolean No if true it is possible to convert to outlines a list of named anchors (label)
or a headings structure (

...

).
Transforming of HTML hyperlinks to PDF hyperlinks (if not explicitly disabled).
Hyperlink jumps within the same document are supported as well 
localurl boolean No Specifies whether to retrieve image files directly from the local drive 
marginbottom number No Specifies the bottom margin in inches (default) or
centimeters. To specify bottom margin in
centimeters, include the unit=cm attribute. 
marginleft number No Specifies the left margin in inches (default) or
centimeters. To specify left margin in centimeters,
include the unit=cm attribute. 
marginright number No Specifies the right margin in inches (default) or
centimeters. To specify right margin in centimeters,
include the unit=cm attribute. 
margintop number No Specifies the top margin in inches (default) or
centimeters. To specify top margin in centimeters,
include the unit=cm attribute. 
mimetype string No mimetype of the source (when attribute src or srcfile are defined) 
name string No name of a variable to store the output in it 
orientation string No is the orientation landscape or portrait 
overwrite boolean No define if a existing file will be overwritten or not 
ownerpassword string No Specifies an owner password (format="PDF" only). 
pageheight number No used when pagetype is custom 
pagetype string No defined the used format for the page (,legal,letter,A4,A5,B4,B5,B4-JIS,B5-JIS and custom) 
pagewidth number No used when pagetype is custom 
permissions string No define permissions for the file (AllowPrinting,AllowModifyContents,AllowCopy,AllowModifyAnnotations,AllowFillIn,AllowScreenReaders,AllowAssembly,AllowDegradedPrinting) 
proxyhost string No alias for proxyHost 
proxypassword string No When required by a proxy server, a valid password. 
proxyport number No The port number on the proxy server from which the object is requested. Default is 80. When
used with resolveURL, the URLs of retrieved documents that specify a port number are automatically
resolved to preserve links in the retrieved document. 
proxyuser string No When required by a proxy server, a valid username. 
saveasname string No (format="PDF" only) The filename that appears in the SaveAs dialog when a user saves a PDF file written to the browser. 
scale number No define a scale factor as a percentage. this option is used to reduce the size of the HTML output so that it fits on that paper. define a number less than 100. 
src string No define a url or or a relative path on the local system to a file that should be transferred to a pdf 
srcfile string No define a absolute path to a file that should be transferred to a pdf 
unit string No set the unit for pageheight, pagewidth, and margin... 
useragent string No Text to put in the HTTP User-Agent request header field. Used to identify the request client software. 
userpassword string No Specifies a user password (format="PDF" only).