Files
Charan Rathore bf27cb259a Vendor and patch hayro-cmap for tolerant CMap parsing
A /ToUnicode CMap with any unparsable part made the reading path
discard the whole map and fall back to the font encoding, so search
and redaction missed text the edit layer could read.  Vendor
hayro-cmap 0.1.0 and patch it to skip malformed bfchar/bfrange
entries, unresolvable usecmap references and unparseable tails,
keeping every readable entry, matching MuPDF/pdftotext and
PdfCraft's own edit-layer parser.

Fixes #3177.

Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
2026-10-18 13:07:15 +05:30

805 B

hayro-cmap

Crates.io Documentation

A parser for cmap files, as they are found in PDFs.

This crate provides a parser for CMap files and allows you to

  • Map character codes from text-showing operators to CID identifiers.
  • Map CIDs to Unicode characters or strings.

Safety

This crate forbids unsafe code via a crate-level attribute.

License

Licensed under either of

at your option.