PDF Decryptor Skill
This skill removes password protection from encrypted PDF files, creating unlocked copies that can be freely accessed.
Dependencies
- Python 3.7+
pikepdflibrary (seerequirements.txt)
Installation
Install dependencies:
pip install -r skillset/pdf-decryptor/requirements.txt
Usage
Decrypt a single PDF
python skillset/pdf-decryptor/decrypt_pdf.py --input "path/to/encrypted.pdf" --output "path/to/decrypted.pdf" --password "your-password"
Decrypt multiple PDFs with the same password
python skillset/pdf-decryptor/decrypt_pdf.py --input "file1.pdf" "file2.pdf" "file3.pdf" --password "your-password"
When multiple input files are provided without --output, the script will automatically generate output filenames by appending _unlocked to the original filename.
Script Options
--inputor-i: Input PDF file path(s). Can specify multiple files.--outputor-o: Output PDF file path (optional for single file, auto-generated for multiple files).--passwordor-p: Password to decrypt the PDF(s).--overwrite: Overwrite output files if they already exist.
Notes
- Output files are saved with the same directory as input unless a full output path is specified
- For multiple files, output names are automatically generated as
{original_name}_unlocked.pdf - The script validates that input files exist and are readable before processing
- Uses
pikepdfwhich handles various PDF encryption types reliably