Repository navigation
⚡ RasgaPDF v0.4.2 — Full ISO 32000-2:2020 (PDF 2.0) Compliance & Metadata Standardization
This release upgrades the pure-Rust spatial PDF engine (src/engine/) to full compliance with ISO 32000-2:2020 (PDF 2.0 — Current Edition) alongside ISO 32000-1:2008 (PDF 1.7), with zero external C dependencies and zero regressions.
🚀 Highlights & New Features
- Accessibility &
/ActualTextReplacement (BDC/BMC/EMC— ISO 32000-2:2020 §14.9.4):- Tracks marked-content property dictionaries in
ContentInterpreter(src/engine/content.rs). - When
/Span << /ActualText (...) >> BDC ... EMCwraps custom ligatures, PUA glyphs, or accessibility replacements, RasgaPDF substitutes the/ActualTextstring while preserving the exact physical bounding box and coalescing mid-word spans seamlessly.
- Tracks marked-content property dictionaries in
- UTF-8 (
0xEF 0xBB 0xBF) & UTF-16BE (0xFE 0xFF) Text Strings (ISO 32000-2:2020 §7.9.2.2):- Native support for 3-byte UTF-8 BOM strings introduced in PDF 2.0 as well as 2-byte UTF-16BE BOM strings across
/ActualTextand/ToUnicodeCMapbeginbfchar/beginbfrangemappings (src/engine/font.rs).
- Native support for 3-byte UTF-8 BOM strings introduced in PDF 2.0 as well as 2-byte UTF-16BE BOM strings across
- Hybrid Cross-Reference
/XRefStmSupport (ISO 32000-2:2020 §7.5.8.4):- Resolves supplemental
/XRefStmbinary cross-reference streams referenced from classic ASCIItrailerdictionaries (src/engine/xref.rs), unlocking compressed object streams (/Type /ObjStm) in hybrid-reference PDFs.
- Resolves supplemental
- Font
/EncodingDictionaries with/Differences&MacRomanEncoding(ISO 32000-2:2020 §9.6.5):- Parses
/Encodingdictionaries (<< /BaseEncoding ... /Differences [ code /glyphname ... ] >>) and named encodings (/MacRomanEncoding,/WinAnsiEncoding), mapping Adobe Glyph List (AGL) names, ligatures (/fi,/fl,/ff,/ffi,/ffl), accented Latin glyphs, and/uniXXXX//uXXXXhex glyph names (src/engine/font.rs,src/engine/doc.rs).
- Parses
- Complete Text State Operators (
Tc,Tw,Tz,"— ISO 32000-2:2020 §9.3–9.4):- Implements character spacing (
Tc), word spacing (Tw), horizontal scaling (Tz), and the quote-and-spacing operator (") in glyph advance andTJkerning calculations (src/engine/content.rs).
- Implements character spacing (
- Deterministic
/EncryptTrailer Detection (ISO 32000-2:2020 §7.6):- Detects
/Encryptdictionaries in the PDF trailer and returns an explicit, deterministic error instead of attempting to parse encrypted byte streams (src/engine/doc.rs).
- Detects
- License Metadata Standardization (PEP 639 & SPDX):
- Reconciled package metadata across PyPI, Crates.io, and npm. PyPI now embeds standard
License-Expression: AGPL-3.0-or-laterand bundled license files, eliminating discrepancies across package indexers.
- Reconciled package metadata across PyPI, Crates.io, and npm. PyPI now embeds standard