Simon Steiner created PDFBOX-6353:
-------------------------------------
Summary: Marked-content extractor compares every glyph with all
earlier ones and never resets, so crafted PDFs can hang it
Key: PDFBOX-6353
URL: https://issues.apache.org/jira/browse/PDFBOX-6353
Project: PDFBox
Issue Type: Bug
Reporter: Simon Steiner
PDFMarkedContentExtractor is a public PDFBox class for pulling tagged (marked)
content out of PDF pages. To drop overlapping duplicate glyphs,
processTextPosition keeps every glyph seen so far in the instance field
characterListMapping, keyed by its Unicode string. It checks each new glyph
against every earlier glyph with the same string, one by one. Duplicate
suppression is on by default (suppressDuplicateOverlappingText = true). The
list is never cleared, neither per page nor per document, and nothing limits
its size. So a content stream that shows one character many times at different
positions costs work that grows with the square of the glyph count. A reused
instance also keeps all earlier glyphs in memory and wrongly drops text on
later pages or documents that sits at the same position as identical earlier
text.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]