Command-line arguments
The latest release includes support for command-line arguments. This feature allows PDFEncrypt to be fully automated and incorporated into existing user workflows.
The following command-line options are available:
-i [input filename] or --input [input filename] - Specify the input PDF file to be encrypted
-o [output filename] or --output [output filename] - Specify the output (destination) encrypted PDF file
--user_pass [user password] - Set user password for file
--owner_pass [owner password] - Set owner password for file
--run - Run the encryption operation without waiting for the user to click the Encrypt button. (Be sure to configure the desired Settings in PDFEncrypt before using this option.)
Owner password
PDFEncrypt now provides the ability to define an Owner Password. Previously, the encryption routine would generate a random Owner password at encryption time. Some users have expressed a need to access the PDF with owner permissions, so we have added the ability to specify the owner password manually. Note that if the owner password is not specified, PDFEncrypt will generate a random password.
Various bug fixes
We’ve also fixed a few bugs and made a few aesthetic modifications.
New installer
We have switched to InnoSoft Setup as the installer app, which will hopefully make the deployment process simpler for new releases. The installer now supports the /silent and /verysilent options, as well as options to install in administrator mode (all users) or current user mode (only the current user).
Hello:
Can you please provide an example of a command line prompt and include in this web page: https://pdfencrypt.net/new-release-command-line-arguments-owner-password/?
For example: “c:\>pdfencrypt -i c:\test.pdf -o c:\test_pwd.pdf –user_pass 12345”
did not work for me and there seems to be no working examples anywhere that I can find? Don’t know how to use it with it Command Line Prompt!
Thanks.
Please ensure you have the latest version, 1.1.8462.22528, as available from the PDFEncrypt.net website. Previous versions do not support command line.
Example of command-line encryption (tested and working):
Please ensure to encapsulate filenames in quotes in case spaces are present.
It is imperative to include the
--run
argument in order to run the encryption from the command line. Otherwise, it will simply open the GUI with the command line options already filled in.PDFEncrypt -i "c:\temp\my_pdf_file.pdf" -o "c:\temp\encrypted_pdf_file.pdf" --user_pass MyPassword --run
Is there an argument to automatically close the program (need this for a batch run)?
You need to go into Settings (launch PDFEncrypt without any command line arguments) and enable the “Close PDFEncrypt” option in the ‘After successful encryption’ section as shown below. Subsequent runs of the app (including from Command Line) will close PDFEncrypt after encryption finishes.
I only want to encrypt so contents cannot be changed or copied. But user can read and print without use of password. How do have these settings in PDFEncrypt?
The PDF standard supports a set of “permissions” which you can configure in the Settings page. Using these permissions, you can control what actions a viewer can take. If they open the PDF with the “user” password, these permissions would be applied. If they open the PDF with the “owner” password, the user would have full permissions.
PLEASE NOTE that some PDF viewer applications, such as Firefox PDF viewer and QPDF, ignore these permissions and give the user FULL access to the PDF even if they open it with the “user” password.
Please read my article on DRM and PDF files for more information.