Hi,

this is pretty much my first day with pdfbox but I can't find anything obvious I'm doing wrong. 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.

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.

Result of this bug(!?) is a nicely shown background but absolutely no text in the pdf.

Regards,
Alex

Reply via email to