Written by

System Analyst at First Line Software
Question Flávio Lúcio Naves Júnior · Jun 25, 2021

PDF with Password

Hello Everyone,

I have a question, someone know how to put a password in a pdf file? Or in a pdf base64?

Best regards, Flávio.

Comments

Jeffrey Drumm · Jun 25, 2021

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.

0
Jeffrey Drumm  Jun 25, 2021 to Flávio Lúcio Naves Júnior

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.

0
Rodolfo Pscheidt Jr · Jun 8, 2022

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

0