-
fix: pdfminer drops extractable text (#4310)
发布于
2026-04-01 18:51:00 +00:00 Note
Medium Risk
Changes pdfminer integration to override CID font/CMap handling and
introduces custom stream decoding/parsing, which can affect text
extraction behavior and performance on diverse PDFs (mitigated by
size/mapping caps).Overview
Fixes PDFs where body text was silently dropped because CIDFonts
used an embedded Encoding CMap stream thatpdfminer.sixdoesn’t
resolve.Adds a bounded embedded-CMap decoder/parser and wires it in via
CustomPDFCIDFont+CustomPDFResourceManagersoinit_pdfminer()
constructs CID fonts with a parsed CMap (includingWMode), with
DoS-oriented caps on decompression and total mappings.Updates tests with a new fixture-driven regression for both
FASTand
HI_RESstrategies plus targeted unit tests for CMap parsing/stream
decoding, and bumps version to0.22.12with a changelog entry.Written by Cursor
Bugbot for commit
4326b15f6c400e81112f894576941d28fb150da7. This will update automatically
on new commits. Configure
here.
Co-authored-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
下载附件