Do you need the eventual user to be prompted for a password when opening the PDF? If so, you'll need to push it through an external application/utility (under IRIS/Cache control) that supports command-line password protection for the output file.
If you just need to encrypt the file for delivery but don't need the user to be prompted for a password when opening the document, there are a number of encryption options in the %SYSTEM.Encryption class.
The tools for doing this will vary by platform, but a utility called qpdfsupports your needs for most modern Unix/Linux variants. You would call it from ObjectScript using the $ZF(-100) function.
You can use pdfbox which is already used by ZEN for some pdf conversions. To make a pdf require a password, just run this command with $ZF(-100): java -cp /opt/cachesys/fop/lib/pdfbox-app-1_7_1.jar org.apache.pdfbox.Encrypt -U 12345 /arquivos/file.pdf
Do you need the eventual user to be prompted for a password when opening the PDF? If so, you'll need to push it through an external application/utility (under IRIS/Cache control) that supports command-line password protection for the output file.
If you just need to encrypt the file for delivery but don't need the user to be prompted for a password when opening the document, there are a number of encryption options in the %SYSTEM.Encryption class.
I need the prompt for the user.
The tools for doing this will vary by platform, but a utility called qpdf supports your needs for most modern Unix/Linux variants. You would call it from ObjectScript using the $ZF(-100) function.
You can use pdfbox which is already used by ZEN for some pdf conversions. To make a pdf require a password, just run this command with $ZF(-100):
java -cp /opt/cachesys/fop/lib/pdfbox-app-1_7_1.jar org.apache.pdfbox.Encrypt -U 12345 /arquivos/file.pdf