Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Field Editor (local)

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.

How it works

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

Web UI (recommended)

./run.sh

Open http://127.0.0.1:5001 — upload a PDF, edit any field (changed fields turn blue), click Apply & Download.

Command line

Read every text field:

./venv/bin/python cli.py read input.pdf

Edit 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"

Files

  • app.py — Flask web UI
  • cli.py — command-line interface
  • pdf_edit.py — core read/edit logic (PyMuPDF)
  • run.sh — creates the venv on first run and starts the server

Notes / limitations

  • 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages