You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2014/09/05 20:00:28 UTC

[jira] [Commented] (PDFBOX-2320) IOException: Could not read embedded TTF for font TimesNewRoman

    [ https://issues.apache.org/jira/browse/PDFBOX-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14123266#comment-14123266 ] 

John Hewson commented on PDFBOX-2320:
-------------------------------------

The log is showing "SEVERE: The end of the stream doesn't point to the correct offset, using workaround to read the stream" and the TTF error is caused by "java.util.zip.DataFormatException: invalid block type". So this looks like a problem with the xref recovery mechanism or stream parsing - [~lehmi]?

> IOException: Could not read embedded TTF for font TimesNewRoman
> ---------------------------------------------------------------
>
>                 Key: PDFBOX-2320
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2320
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.0
>            Reporter: simon steiner
>
> http://svn.apache.org/viewvc/incubator/pdfbox/trunk/test/input/TEST_SetCharSpacing_Error.pdf?revision=682412&view=co&pathrev=793348
> java -jar ~/pdf-box-svn/app/target/pdfbox-app-2.0.0-SNAPSHOT.jar PDFToImage -nonSeq TEST_SetCharSpacing_Error.pdf
> {code}
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.pdfparser.NonSequentialPDFParser validateStreamLength
> SEVERE: The end of the stream doesn't point to the correct offset, using workaround to read the stream
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.pdfparser.NonSequentialPDFParser validateStreamLength
> SEVERE: The end of the stream doesn't point to the correct offset, using workaround to read the stream
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Sep 5, 2014 10:56:40 AM org.apache.pdfbox.filter.FlateFilter decode
> SEVERE: FlateFilter: stop reading corrupt stream due to a DataFormatException
> Exception in thread "main" java.io.IOException: Could not read embedded TTF for font TimesNewRoman
> 	at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.<init>(PDTrueTypeFont.java:116)
> 	at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:73)
> 	at org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:171)
> 	at org.apache.pdfbox.util.PDFStreamEngine.getFonts(PDFStreamEngine.java:543)
> 	at org.apache.pdfbox.util.operator.text.SetTextFont.process(SetTextFont.java:48)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:275)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:240)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:194)
> 	at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:176)
> 	at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:228)
> 	at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:160)
> 	at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:109)
> 	at org.apache.pdfbox.tools.PDFToImage.main(PDFToImage.java:265)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
> Caused by: java.io.IOException: java.util.zip.DataFormatException: invalid block type
> 	at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:83)
> 	at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:365)
> 	at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:286)
> 	at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:189)
> 	at org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:232)
> 	at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.<init>(PDTrueTypeFont.java:108)
> 	... 18 more
> Caused by: java.util.zip.DataFormatException: invalid block type
> 	at java.util.zip.Inflater.inflateBytes(Native Method)
> 	at java.util.zip.Inflater.inflate(Inflater.java:238)
> 	at java.util.zip.Inflater.inflate(Inflater.java:256)
> 	at org.apache.pdfbox.filter.FlateFilter.decompress(FlateFilter.java:101)
> 	at org.apache.pdfbox.filter.FlateFilter.decode(FlateFilter.java:74)
> 	... 23 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)