Skip to content

Repository files navigation

PDF Password Remover — remove passwords from PDF files on macOS

PDF Password Remover

Batch-remove password protection from PDF files on macOS. Includes a Finder service (right-click menu) and a command-line tool for automation.

Passwords are stored in the macOS Keychain — encrypted by the system, never written to disk or committed to git.

Features

  • Unlock all PDFs in a folder in one run
  • Recursive or current-folder-only mode
  • Try multiple passwords from Keychain (useful when files use different passwords)
  • Finder Quick Action: right-click a folder → Unlock PDFs
  • Safe defaults: writes *-unlocked.pdf copies; optional in-place replace with backup

Requirements

  • macOS 12 or later
  • Homebrew (install script uses it for qpdf)

Installation

git clone https://github.com/mortolian/pdf-password-remover.git
cd pdf-password-remover
chmod +x install.sh
./install.sh

The installer will:

  1. Install qpdf via Homebrew (if needed)
  2. Install pdf-unlock, pdf-password, and pdf-unlock-finder to ~/.local/bin
  3. Copy the Unlock PDFs Quick Action to ~/Library/Services

If ~/.local/bin is not on your PATH, add to ~/.zshrc:

export PATH="$HOME/.local/bin:$PATH"

Enable the Quick Action: System Settings → Privacy & Security → Extensions → Finder (if prompted).

Quick start

1. Store your password(s) in Keychain

pdf-password add          # name: default
pdf-password add work     # optional second password
pdf-password list         # shows names only, never the passwords

macOS may prompt once to allow Terminal (or the Quick Action) to access the Keychain.

2. Unlock PDFs

Command line — current folder only:

pdf-unlock ~/Documents/invoices

Include all subfolders:

pdf-unlock -r ~/Documents/invoices

Replace originals (creates .bak backup first):

pdf-unlock --in-place ~/Documents/invoices

Dry run (see what would happen):

pdf-unlock -n -r ~/Documents/invoices

Use in Finder

After ./install.sh, one Finder service is installed: Unlock PDF

Right-click on Menu item
A PDF file or folder Unlock PDF

Look under Services (hold ⌥ Option while right-clicking if needed).

If the menu item is missing (macOS 26 Tahoe)

System Settings → Keyboard → Keyboard Shortcuts → Services → Files and Folders

Turn on Unlock PDF, then restart Finder:

killall Finder

If you see "not configured correctly" or it fails silently

Run these in Terminal:

pdf-password trust
./install.sh

Then check the log after trying again in Finder:

tail -20 ~/Library/Logs/pdf-password-remover.log

Where passwords are stored

Location Used? Why
macOS Keychain Yes Encrypted, OS-managed, supports multiple labels; best practice on Mac
.env / config files No Risk of accidental git commit
Command-line arguments No Visible in shell history and process list
This git repo No Never store secrets in version control

Keychain service name: pdf-password-remover. Account name is the label you choose (default, work, etc.).

Output behavior

Mode Result
Default report.pdfreport-unlocked.pdf
--in-place Replaces report.pdf; backup at report.pdf.bak
--output DIR Writes unlocked files under DIR

Non-encrypted PDFs are skipped. Files already named *-unlocked.pdf are ignored.

Automation

Use pdf-unlock in shell scripts, cron, or launchd jobs:

#!/bin/zsh
export PATH="$HOME/.local/bin:$PATH"
pdf-unlock -r -q /Users/you/Inbox/PDFs

-q prints only errors and the summary.

Uninstall

./uninstall.sh

Removes CLI tools and the Quick Action. Keychain entries remain until you remove them:

pdf-password remove default

Project layout

pdf-password-remover/
├── assets/
│   └── banner.png           # README banner image
├── bin/
│   ├── pdf-unlock           # Main batch unlock CLI
│   ├── pdf-password         # Keychain password management
│   └── pdf-unlock-finder    # Finder Quick Action helper
├── quick-action/
│   └── Unlock PDFs.workflow # macOS Quick Action bundle
├── install.sh
├── uninstall.sh
├── README.md
├── SECURITY.md
└── LICENSE

Security

See SECURITY.md. Use only on PDFs you own or are authorized to decrypt.

License

MIT

About

Batch remove PDF password protection on macOS — Keychain-secured passwords, CLI, and Finder Quick Action.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages