A small local tool to read and edit text fields in a PDF, then download the result. Runs entirely on your machine — nothing is uploaded anywhere.
These PDFs (e.g. the Plum prescription) are flat text PDFs — they have no fillable form fields; the text is painted onto the page. So "editing a field" means: white-out the original text rectangle and repaint your new text in the same position, size and colour.
Embedded fonts are usually subset (they only carry glyphs already used in the doc), so they can't draw new letters. Replacements are repainted in a full system sans-serif (Arial by default — close to OpenSans). Override with:
export REPLACEMENT_FONT=/path/to/OpenSans-Regular.ttf./run.shOpen http://127.0.0.1:5001 — upload a PDF, edit any field (changed fields turn blue), click Apply & Download.
Read every text field:
./venv/bin/python cli.py read input.pdfEdit by exact current text and write a new file:
./venv/bin/python cli.py edit input.pdf output.pdf \
--set "Ramasharay Prasad=Vishal Kumar" \
--set "51 yrs / Male=29 yrs / Male"app.py— Flask web UIcli.py— command-line interfacepdf_edit.py— core read/edit logic (PyMuPDF)run.sh— creates the venv on first run and starts the server
- Best for single-line text fields (names, dates, numbers). Long paragraphs that wrap are repainted as a single line at the original baseline.
- Repainted text is selectable and searchable in the output.
- The replacement font is a near-match, not pixel-identical to the original.