Skip to content

SurfyPenguin/pdf-highlighter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Keyword Highlighter

A command-line tool to highlight one or more keywords in a PDF file using PyMuPDF. Supports multiple keywords, optional case-sensitive search, and outputs per-page highlight statistics.

Requirements

  • Python >=3.12
  • PyMuPDF: pip install pymupdf

Usage

usage: Highlight keywords in PDF [-h] -i INPUT [-o OUTPUT] -k KEYS [KEYS ...] [-s]

options:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Input PDF
  -o OUTPUT, --output OUTPUT
                        Output PDF
  -k KEYS [KEYS ...], --keys KEYS [KEYS ...]
                        Keyword(s) to highlight. Sentences are not supported
  -s, --sensitive       Case-sensitive search

Examples

python3 main.py -i input.pdf -k python code script -o highlighted.pdf

python3 main.py -i input.pdf -k Python -s -o output.pdf  # case-sensitive

This script was originally developed in response to an open issue in the wasmerio/Python-Scripts repository:
#478 - PDF Keyword Scanner & Highlighter Script

About

A command-line tool to highlight one or more keywords in a PDF file using PyMuPDF. Supports multiple keywords, optional case-sensitive search, and outputs per-page highlight statistics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages