Skip to content

v0.4.0 - remove() + JSON manifest

Latest

Choose a tag to compare

@san64777 san64777 released this 08 Jun 23:44
· 13 commits to main since this release
cce1dcf

Adds remove(pdf, names), completing the engine's CRUD (build / read_fields / fill / remove).

remove()

Delete specific AcroForm fields by the name read_fields reports, so the two compose:

specs = af.read_fields(pdf)
junk = [s.name for s in specs if s.type == af.FieldType.SIGNATURE]
clean = af.remove(pdf, junk)        # raises if any name is missing

Deletes by fully-qualified name via pure object surgery (no appearance regeneration). Naming a radio group removes the whole group; removing the last field leaves an empty, re-usable /AcroForm; /XFA is stripped. Validated on 125 real public forms (incl. encrypted and XFA) with zero crashes.

JSON manifest

detect() / read_fields() return pydantic models - serialize and round-trip them with model_dump_json() / model_validate_json() for the detect -> review/edit -> build flow. No new API.

Install: pip install acroforge==0.4.0