Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 2.49 KB

File metadata and controls

76 lines (53 loc) · 2.49 KB

Ultimate PDF Watermarker

A robust, interactive command-line tool to apply watermarks to PDF documents. Designed for speed and ease of use, this tool supports terminal drag-and-drop, batch processing, and directory scanning so you can watermark hundreds of files in seconds.

Features

  • Interactive Drag & Drop: No need to type out long file paths. Just drag and drop your PDFs directly into the terminal.
  • Batch Processing: Drop multiple files at once. The script uses shlex to safely parse complex file paths, escaped characters, and spaces across all operating systems.
  • Directory Support: Drop an entire folder into the terminal. The script will automatically find all PDFs inside and process them.
  • Non-Destructive: Your original files are never overwritten.
    • Single files are saved as watermarked_[filename].pdf.
    • Directory batches are saved into a clean watermarked_outputs subfolder.
  • Graceful Error Handling: Corrupted PDFs or invalid paths won't crash the program; it logs the error and moves to the next file.

Prerequisites

  • Python 3.6 or higher
  • pypdf library

Installation

  1. Clone or download this repository.
  2. Install the required Python dependencies using pip:
pip install pypdf

Usage

  1. Open your terminal or command prompt.

  2. Run the script:

python pdf_watermarker.py
  1. Step 1: The script will ask for your watermark file. Drag and drop your single-page watermark PDF into the terminal and press Enter.

  2. Step 2: The script will ask for your target files. You can:

    • Drag and drop a single PDF.

    • Highlight multiple PDFs, drag, and drop them all at once.

    • Drag and drop a folder containing PDFs.

  3. Press Enter to process.

  4. Type q, quit, or exit when you are done.

Example Workflow

==================================================
           ULTIMATE PDF WATERMARKER               
==================================================
INSTRUCTIONS:
1. Drag & Drop the WATERMARK PDF first.
2. Drag & Drop one or MANY PDFs/FOLDERS to process.
3. Type 'exit' or 'q' to quit at any time.

Target Watermark: /Users/Name/Desktop/watermark.pdf
Using: watermark.pdf

Drop PDFs or Folders (or 'q'): /Users/Name/Documents/Invoices/
Scanning directory: /Users/Name/Documents/Invoices
  [SUCCESS] -> invoice_001.pdf
  [SUCCESS] -> invoice_002.pdf
------------------------------
Drop PDFs or Folders (or 'q'): quit
Goodbye!

License

MIT License. Feel free to use and modify for your own production environments.