Repository navigation
v1.3.0
gopdfrab 1.3.0 adds a verification-only package and WebAssembly module, makes
every binary smaller and conversion faster, and closes several ways a
conversion could lose content or write a broken file while reporting success.
Every addition is backwards compatible; three lookups are deprecated.
Highlights
- Verify without the converter:
github.com/voidrab/gopdfrab/verifyis the
verification API alone, under the same names and over the same types, so
switching is an import swap. The new./wasm/verifymodule is about 6.2 MB
against the full module's 15.1 MB, so a page can load it first and fetch the
converter only to convert. - Smaller, faster: every binary is about 1 MB smaller (1.6 MB in
WebAssembly) now that the Arlington object model ships as embedded data.
Conversion makes about a third fewer allocations and runs about 15% faster on
object-heavy files; verification allocates 6–14% less. - No more silent loss: embedded files and forbidden annotations removed by
a conversion are listed inLostObjects, and optional content layers the
document hides stay hidden instead of becoming visible. - No more corrupt "conformant" output: a stream shared by several objects,
or a font program shared by several fonts, is now repaired everywhere it is
used, not through one reference only. - Fewer rasterized pages and better ones: opaque transparency groups,
including those that draw nested forms, stay vector. Transparency flattening
keeps light and overlapping fills, and the raster fallback draws CFF, Type 1
and TrueType glyphs and colour spaces correctly. - Verify cannot be flooded: a violation repeated throughout a content
stream is reported once per check with a count, instead of once per
operator, which could run verify out of memory. - Level-qualified lookups and named profiles:
CheckByClauseIn,
ChecksForClauseIn,Check.ClauseIn,Check.AppliesTo,ProfileByName,
ProfilesandProfile.Name.
Behaviour changes
- Content-stream issues are counted, not repeated: callers that count
Issuessee one issue per check and stream where they saw one per operator. ConvertObjectModeland thePDFprofile no longer mark the output as
PDF/A-1b (XMP identifier, OutputIntent, font repairs).- An
ObjectModelprofile that enables a PDF/A check is rejected with an
error naming the check, instead of being verified by PDF/A-1b's rules. LostObjectsnow lists removed attachments, forbidden annotations and
hidden optional content.
These make results more correct, which the stability policy treats as fixes.
Deprecated
CheckByClause, ChecksForClause and Profile.Allows read PDF/A-1 clauses
only. Use CheckByClauseIn, ChecksForClauseIn and Profile.Has. They stay
until the next major version.
Install
go get github.com/voidrab/gopdfrab@v1.3.0
go install github.com/voidrab/gopdfrab/cmd/gopdfrab@v1.3.0
Or download a CLI binary below. They are static, built with CGO_ENABLED=0;
verify with sha256sum -c checksums.txt.
The full list of additions, changes and fixes is in
CHANGELOG.md.