Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.12
Description
I'm using PDFTextStripperByArea, this code makes it die:
stripper.extractRegions(page);
Assuming, the language is Chinese or Japanese, that's the error:
===========
Oct 19, 2018 1:24:50 AM org.apache.pdfbox.pdmodel.font.PDFont getSpaceWidth
SEVERE: Can't determine the width of the space character, assuming 250
java.io.IOException: Unexpected end of stream
at org.apache.pdfbox.pdmodel.font.PDType3CharProc.getWidth(PDType3CharProc.java:170)
at org.apache.pdfbox.pdmodel.font.PDType3Font.getWidthFromFont(PDType3Font.java:165)
at org.apache.pdfbox.pdmodel.font.PDFont.getSpaceWidth(PDFont.java:547)
at org.apache.pdfbox.text.LegacyPDFStreamEngine.showGlyph(LegacyPDFStreamEngine.java:265)
at org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:734)
at org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:595)
=========
Should I use something else instead of PDFTextStripperByArea?
Let me know if more information needed. I attached the PDF file.output.pdf
====
To reproduce use the attached above output.pdf and the standard PDFBox app:
java -jar pdfbox-app-2.0.12.jar ExtractText output.pdf