[
https://issues.apache.org/jira/browse/PDFBOX-6364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18154651#comment-18154651
]
Tilman Hausherr edited comment on PDFBOX-6364 at 12/3/26, 2:17 PM:
-------------------------------------------------------------------
Did you check this on the current trunk? I can't find the NPE. Here's how the
code looks:
{code:java}
if (bead == null || bead.getRectangle() == null)
{
// can't skip, because of null entry handling in
processTextPosition()
beadRectangles.add(null);
continue;
}
PDRectangle rect = bead.getRectangle();
{code}
was (Author: tilman):
Did you check this on the current trunk? I can't find the NPE. Here's how the
code looks:
if (bead == null || bead.getRectangle() == null)
{
// can't skip, because of null entry handling in
processTextPosition()
beadRectangles.add(null);
continue;
}
PDRectangle rect = bead.getRectangle();
> Text extraction checks every article bead for every glyph, so a small PDF can
> keep it busy for hours
> -----------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-6364
> URL: https://issues.apache.org/jira/browse/PDFBOX-6364
> Project: PDFBox
> Issue Type: Bug
> Reporter: Simon Steiner
> Priority: Major
>
> With the default shouldSeparateByBeads=true, PDFTextStripper.processPage
> loads every entry of the page's /B (article bead) array with no limit. Then,
> for every glyph, processTextPosition loops over all of those beads,
> rebuilding each bead's PDRectangle from its /R entry and testing whether it
> contains the glyph. The work per page is glyphs × beads, and the document
> sets both numbers. A compressed PDF can repeat one bead reference very many
> times and show very many glyphs. Separately, a bead with no /R makes
> getRectangle() return null, and the unchecked rect.contains() throws
> NullPointerException, which aborts extraction of the whole document.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]