v0.51.0 — a PDF Acrobat wrote could not be opened, and now it can
The headline: a PDF Acrobat wrote could not be opened, and now it can
A blank spacer page with no /Resources — which Acrobat writes, in its own
stamp files, on your own machine — made pdfcer refuse the whole document,
including the pages that were perfect. Every verb that walks the page tree was
affected: render-page, extract-pages, set-page-size, extract-text.
An absent resource dictionary now resolves to the empty dictionary the
standard itself names for "this page requires no resources" (ISO 32000-1
Table 30), and pdfcer says it did so — page_resources_defaulted=1 on the
render line, a per-page note on extraction. /MediaBox deliberately did not
move: no clause anywhere names a default page size, so any value would be
invented. The line is invention, not strictness.
★ pdfcer's own smallest test fixture had the same shape, so the engine could
not read the minimal file the project ships.
A stamp restyle was eating your stamp's words
Changing a placed stamp's colour silently replaced its custom label with
the stamp name's default — APPROVED FOR CONSTRUCTION became DRAFT.
Measured on a real file, from a control captioned "colour". Fixed, with a
regression test.
If a document was restyled with an earlier build, pdfcer list-annotations
now prints stamp_label= per annotation, which makes a sweep cheap.
Custom stamps: place them, size them, hear about it
pdfcer place-stampputs a stamp collection's artwork on a page as
vector — a form XObject behind a/Stampannotation, which is what
Acrobat writes. Selectable, movable, deletable, and the page's own content
stream is never touched.--stamp NAMEaddresses a stamp the way
stamp-listprints it;--at X,Yplaces at the artwork's own size,
--rectfills a box.- A placed stamp's label size can be read and changed —
set-text-annot-style --font-size, andlist-annotationsreports the size
and where it came from (the author stated it / pdfcer read it off the
picture / the file contradicts itself). - A shrunk or clipped label reports itself, so
--stamp-fit shrinkand
clipare usable at last: pdfcer names the size it chose and how many
characters did not fit.
⚠ A dynamic stamp places its design-time text. Its words come from Acrobat
JavaScript that pdfcer does not run, and the CLI says so when you place one.
Also in this release
- A
/Textor/Stampannotation that names a standard icon but carries
no appearance is now drawn from pdfcer's own artwork, as §12.5.6.4 and
§12.5.6.12 require of a reader. stamp-pack --stamps-from FILE, because a real artwork sheet is 113 pages
and nobody types 113--stampflags.- A page-tree failure stops being reported as "every stamp points at
nothing" —page=UNKNOWN, and the real cause named.
For anyone building against pdfcer-core
EditSession::place_page_artwork, add_text_annotation_reporting,
stamp_label_parameters, annot::stamp_label_parameters_in, and
TextAnnotStyle::font_size / stamp_fit. Page::resources_defaulted and
Diagnostics::page_resources_defaulted carry the new disclosure. One new
error variant, EditError::SourcePageOutOfRange. Full contract in
docs/core-api/.
Verified: cargo test --workspace 5,309 pass; tools/run-gates.sh green;
every Pass checked against the operator's own Acrobat-authored stamp file
rather than only against fixtures.