pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Lanin" <a...@lanin.de>
Subject AW: java.lang.NullPointerException at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:343)
Date Tue, 31 Dec 2013 12:56:41 GMT
Hi,

sorry, I was unclear. I don't think it's related. That’s just the version I've checked out
from git.

I've just tried loadNonSeq(), thanks for the hint. Unfortunately that didn't change anything.

Nevertheless there is possibly another issue: the very first output is a different error.
I didn't see it before because eclipse console can only buffer 1MB of output which is full
in way under 1 second...

Dez 31, 2013 1:44:18 PM org.apache.pdfbox.util.PDFStreamEngine processOperator
Information: unsupported/disabled operation: i
Dez 31, 2013 1:44:21 PM org.apache.pdfbox.util.PDFStreamEngine processOperator
Warnung: java.lang.ArrayIndexOutOfBoundsException: 5
java.lang.ArrayIndexOutOfBoundsException: 5
	at org.apache.fontbox.cff.IndexData.getBytes(IndexData.java:43)
	at org.apache.fontbox.cff.CFFParser.readString(CFFParser.java:582)
	at org.apache.fontbox.cff.CFFParser.readFormat1Charset(CFFParser.java:952)
	at org.apache.fontbox.cff.CFFParser.readCharset(CFFParser.java:914)
	at org.apache.fontbox.cff.CFFParser.parseFont(CFFParser.java:409)
	at org.apache.fontbox.cff.CFFParser.parse(CFFParser.java:120)
	at org.apache.pdfbox.pdmodel.font.PDType1CFont.load(PDType1CFont.java:309)
	at org.apache.pdfbox.pdmodel.font.PDType1CFont.<init>(PDType1CFont.java:90)
	at org.apache.pdfbox.pdmodel.font.PDCIDFontType0Font.<init>(PDCIDFontType0Font.java:66)
	at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:112)
	at org.apache.pdfbox.pdmodel.font.PDType0Font.<init>(PDType0Font.java:68)
	at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:108)
	at org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:204)
	at org.apache.pdfbox.util.PDFStreamEngine.getFonts(PDFStreamEngine.java:580)
	at org.apache.pdfbox.util.operator.SetTextFont.process(SetTextFont.java:54)
	at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:529)
	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:258)
	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:225)
	at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:205)
	at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:152)
	at org.apache.pdfbox.util.RenderUtil.renderPage(RenderUtil.java:213)
	at org.apache.pdfbox.util.RenderUtil.convertToImage(RenderUtil.java:177)

I can mail you the pdf in question directly if you want. I don't want to upload it since it's
copyrighted.

Alex


-----Ursprüngliche Nachricht-----
Von: Andreas Lehmkuehler [mailto:andreas@lehmi.de] 
Gesendet: Dienstag, 31. Dezember 2013 12:50
An: users@pdfbox.apache.org
Betreff: Re: java.lang.NullPointerException at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:343)

Hi,

Am 31.12.2013 02:36, schrieb alex@lanin.de:
>
> Hi,
>
> this is pretty much my first day with pdfbox but I can't find anything 
> obvious I'm doing wrong.
Welcome to our community!

> I'm attempting to display a pdf file, which works quite fine with some pdfs.
> I've already switched to 2.0.0 trunk (from git) in the hopes of 
> getting better results. So the below problem refers to commit 
> "PDFBOX-1808: close the PDF not until the end of the test" aka 3fd34c9ff38227e9bd1e6d853ae85a0a9ee8ede7
on git.
Why do you think it's related to PDFBOX-1808? Does it work without those changes?

> Dez 31, 2013 2:18:10 AM org.apache.pdfbox.util.PDFStreamEngine 
> processEncodedText
> Warnung: java.lang.NullPointerException java.lang.NullPointerException
>      at
> org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:343)
>      at org.apache.pdfbox.util.operator.ShowText.process(ShowText.java:45)
>      at
> org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:529)
>      at
> org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:258)
>      at
> org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:225)
>      at
> org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:205)
>      at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:152)
>      at org.apache.pdfbox.util.RenderUtil.renderPage(RenderUtil.java:213)
>      at 
> org.apache.pdfbox.util.RenderUtil.convertToImage(RenderUtil.java:177)
>
> the null pointer lines are:
> spaceWidthText = (font.getSpaceWidth() * glyphSpaceToTextSpaceFactor); 
> spaceWidthText = (font.getAverageFontWidth() * 
> glyphSpaceToTextSpaceFactor);
>
> So I'm guessing font is null.
Sounds reasonable, but I guess it's maybe another issue. Did you ever try to use the non-sequential
(-nonSeq on the commandline/PDDocument#loadNonSeq insteed of PDDocument#load within your own
source) parser?
If the issue still persists we need to get a hand on the pdf in question. 
Otherwise it'll be hard/impossible to figure out whta the problem cound be.

> Result of this bug(!?) is a nicely shown background but absolutely no 
> text in the pdf.
No font, no text. Doesn't suprise me ;-)

> Regards,
> Alex

BR
Andreas Lehmkühler



Mime
View raw message