mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-10 10:20:32 -06:00
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>
26 lines
805 B
Markdown
26 lines
805 B
Markdown
# hayro-cmap
|
|
|
|
[](https://crates.io/crates/hayro-cmap)
|
|
[](https://docs.rs/hayro-cmap)
|
|
|
|
<!-- cargo-rdme start -->
|
|
|
|
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.
|
|
|
|
<!-- cargo-rdme end -->
|
|
|
|
## License
|
|
Licensed under either of
|
|
|
|
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
|
|
|
|
at your option.
|