Using advanced PDF options

The cfdocument tag supports the Acrobat security options, as the following table shows:

Security option Description

Encryption

Use the encryption attribute to specify whether PDF output is encrypted. Specify one of the following:

  • 128-bit
  • 40-bit
  • none

User password

Use the userpassword attribute to specify a password that users must enter to view the document.

Owner password

Use the ownerpassword attribute to specify a password that users must enter to view and optionally modify the document.

Additionally, the cfdocument tag supports the following Acrobat security permissions through the permissions attribute. Specify one or more of the following values; separate multiple permissions with a comma:

Permission Description

Printing

Specify the AllowPrinting attribute to enable viewers to print the document.

Modification

Specify the AllowModifyContents attribute to let viewers modify the document, assuming they have the required software.

Copy

Specify the AllowCopy attribute to let viewers select and copy text from the document.

Annotation

Specify AllowModifyAnnotations to let viewers add comments to the document. If users add annotations, they must save the PDF after making changes.

Screen readers

Specify AllowScreenReaders to enable access to the document through a screen reader.

Fill in

Specify AllowFillIn to enable users to use form fields.

Assembly

Specify AllowAssembly to enable users to create bookmarks and thumbnails, as well as insert, delete, and rotate pages.

Degraded printing

Specify AllowDegradedPrinting to enable low-resolution printing. Low resolution printing prints each page as a bitmap, so printing may be slower.

Note: The defaults for these options vary, based on encryption level. These options apply to PDF only. For more information, see the cfdocument discussion in CFML Reference.

The following example creates a PDF document that allows copying only:

<cfdocument format="PDF" encryption="40-bit"
   ownerpassword="us3rpa$$w0rd" userpassword="us3rpa$$w0rd"
   permissions="AllowCopy" >
<h1>Employee List</h1>
<cfquery name="EmpList" datasource="cfdocexamples">
   SELECT FirstName, LastName, Salary
   FROM Employee
</cfquery>
<cfoutput query="EmpList">
#EmpList.FirstName#, #EmpList.LastName#, #LSCurrencyFormat(EmpList.Salary)#<br>
</cfoutput>

</cfdocument>

View comments in LiveDocs