You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/06/27 08:17:24 UTC
[jira] [Comment Edited] (PDFBOX-2158) ExtractText missing most of
text in this PDF file, due to font bounding box with minus infinity
[ https://issues.apache.org/jira/browse/PDFBOX-2158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14045591#comment-14045591 ]
Tilman Hausherr edited comment on PDFBOX-2158 at 6/27/14 6:15 AM:
------------------------------------------------------------------
This is the current log output for that file:
{code}
27.06.2014 08:15:07.476 WARN [main] org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader:436 - decode array COSArray{[COSFloat{1.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}]} not compatible with color space, using the first two entries
27.06.2014 08:15:07.477 WARN [main] org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader:436 - decode array COSArray{[COSFloat{1.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}]} not compatible with color space, using the first two entries
27.06.2014 08:15:08.909 WARN [main] org.apache.fontbox.cff.Type1CharString:338 - rlineTo without initial moveTo in font ArialMT, glyph AE
{code}
was (Author: tilman):
This is the current log output for that file:
27.06.2014 08:15:07.476 WARN [main] org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader:436 - decode array COSArray{[COSFloat{1.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}]} not compatible with color space, using the first two entries
27.06.2014 08:15:07.477 WARN [main] org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader:436 - decode array COSArray{[COSFloat{1.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{0.0}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}, COSNull{}]} not compatible with color space, using the first two entries
27.06.2014 08:15:08.909 WARN [main] org.apache.fontbox.cff.Type1CharString:338 - rlineTo without initial moveTo in font ArialMT, glyph AE
> ExtractText missing most of text in this PDF file, due to font bounding box with minus infinity
> -----------------------------------------------------------------------------------------------
>
> Key: PDFBOX-2158
> URL: https://issues.apache.org/jira/browse/PDFBOX-2158
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 1.8.5
> Environment: Windows x64
> Reporter: Joel Hirsh
> Attachments: negative.text.box.pdf
>
>
> Attached PDF file is missing most of the text when processed by the ExtractText example program
> I traced it down to PDFontDescriptorDictionary.getFontBoundingBox() getting a rectange for COSName.FONT_BBOX that contained a ymin value of minus infinity. That method then creates a PDRectangle which calculates a bounding box with a ymin value of -65,329, and results in an enormous text size, and things go downhill from there. The text cannot be matched up, and most of it ends up being discarded.
> I was able to hack a fix by doing a check in the constructor PDRectangle.PDRectangle( COSArray array ) for big negative numbers and setting them to 0. With that change, all the text came through as expected. However, I don't have enough familiarity with the code to understand what a real fix ought to look like.
> The PDF file looks to be fine by other programs such as Acrobat and NitroPDF
--
This message was sent by Atlassian JIRA
(v6.2#6252)