[ 
https://issues.apache.org/jira/browse/PDFBOX-6353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18154238#comment-18154238
 ] 

ASF subversion and git services commented on PDFBOX-6353:
---------------------------------------------------------

Commit 1941140 from Maruan Sahyoun in branch 'pdfbox/branches/3.0'
[ https://svn.apache.org/r1941140 ]

PDFBOX-6353: avoid quadratic cost and stale duplicate detection across pages in 
PDFMarkedContentExtractor by sharing PDFTextStripper's overlapping text filter; 
refactoring and tests by Claude Opus 5.5

> 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
>            Priority: Major
>
> 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]

Reply via email to