Forum Discussion
How to password protect a pdf file on mac?
Yes, podofoencrypt is a valid and completely free method to password protect a PDF on Mac, provided you're comfortable using the command line. It is one of the tools included in the open-source PoDoFo library, which is available for macOS.
First, you'll need to install the PoDoFo tools. The easiest way is via Homebrew:
1. Open the Terminal app.
2. Run the following command: brew install podofo.
Once installed, you can use the following command structure to password protect a PDF on Mac:
bash
podofoencrypt -u "USER_PASSWORD" -o "OWNER_PASSWORD" input.pdf output.pdf
- -u "USER_PASSWORD": The password required to open the PDF. Replace this with your chosen password.
- -o "OWNER_PASSWORD": The password required to change permissions (like printing or copying). This is a required argument.
- input.pdf: The path to your original PDF file.
- output.pdf: The name and path for your new, password-protected PDF.
podofoencrypt also allows you to control what users with the "user password" can do with the document. You can add permission flags to the command to restrict actions:
- --print: Allow printing the document.
- --copy: Allow extraction of text and graphics.
- --edit: Allow modification of the document.
- --fillandsign: Allow filling in forms and adding signatures.
For example, to create a PDF that can be opened with user123 but cannot be printed, you would run:
bash
podofoencrypt -u "user123" -o "owner456" --print input.pdf output.pdf
Note: The --print flag is used to allow printing. If you omit it, printing is disallowed.