O'Reilly logo

ColdFusion 8 Developer Tutorial by John Farrar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Encrypting PDF Documents

There are times when a password is not considered to be secure enough for a PDF document. On these occasions, the solution is the power of encrypting the document. Here is a code sample to achieve this.

<cfpdf action="protect"
source="generatedPDF"
destination="secure.pdf"
encrypt="AES_128"
newOwnerPassword="thePassword"
permissions="none"
overwrite="yes" />

This code allows a person who has the permissions to open the file, but they can't print it or modify it. There are many permissions and they are listed at the end of the chapter. The point here is that we have lots of power to control our documents even after they "leave the building" as we put it.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required