[ https://issues.apache.org/jira/browse/PDFBOX-956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991408#comment-12991408 ]
Mel Martinez commented on PDFBOX-956: ------------------------------------- Kevin, I like the look of this optimization, though I haven't run it yet. One comment: The 52b22bd6.pdf file that you attached as a test case seems a bit problematic. It apparently makes use of javascript. For security reasons I normally run with javascript disabled on PDFs. When I try to open this file with Adobe Reader from Firefox, it properly prompted me with whether to allow the javascript to run and before I could answer it hung up the Adobe Reader for about 90 seconds and then blew away both the Reader (v9.4.0) AND Firefox (v3.6.13). This is on a 64bit Win XP Pro machine (latest patches as of a couple of days ago). After restarting everything I tried once more (thinking maybe Firefox had gotten to a cluttered state) but it did it again right off the bat. I'm not sure what happened at a micro level to cause that but I wonder if the file has some sort of corruption? > Poor text extraction performance in PDFTextStripper.java > -------------------------------------------------------- > > Key: PDFBOX-956 > URL: https://issues.apache.org/jira/browse/PDFBOX-956 > Project: PDFBox > Issue Type: Bug > Components: Text extraction > Affects Versions: 1.4.0 > Reporter: Kevin Jackson > Fix For: 1.5.0 > > Attachments: 52b22bd6_69.pdf, PDFTextStripper.java.patch > > > The worst case performance of the suppressDuplicateOverlappingText logic in > processTextPosition is O(n^2). > The patch is to use a TreeMap to achieve O(N log N) performance. > The example PDF took over 2 hours to extract the text before this patch and > less than 10 minute after. > BTW: The extracted text is also quite different compared to Adobe Reader. > Not sure which is correct but for this document it doesn't matter. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira