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

Tilman Hausherr commented on PDFBOX-2262:
-----------------------------------------

This happens for the PDFBOX-2048-confidential.pdf file when reading the "loca" 
table:
{code}
Aug 28, 2014 8:32:33 PM org.apache.pdfbox.util.TestPDFToImage doTestFile
SCHWERWIEGEND: Error converting file PDFBOX-2048-confidential.pdf
java.io.IOException: Could not read embedded TTF for font 
FAAABC+TimesNewRomanPS-BoldMT
        at 
org.apache.pdfbox.pdmodel.font.PDCIDFontType2.<init>(PDCIDFontType2.java:81)
        at 
org.apache.pdfbox.pdmodel.font.PDFontFactory.createDescendantFont(PDFontFactory.java:123)
        at 
org.apache.pdfbox.pdmodel.font.PDType0Font.<init>(PDType0Font.java:63)
        at 
org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:81)
        at org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:215)
        at 
org.apache.pdfbox.util.PDFStreamEngine.getFonts(PDFStreamEngine.java:569)
        at 
org.apache.pdfbox.util.operator.text.SetTextFont.process(SetTextFont.java:48)
        at 
org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:536)
        at 
org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:269)
        at 
org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:236)
        at 
org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:190)
        at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:161)
        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:95)
        at 
org.apache.pdfbox.util.TestPDFToImage.doTestFile(TestPDFToImage.java:220)
        at 
org.apache.pdfbox.util.TestPDFToImage.testRenderImage(TestPDFToImage.java:332)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at junit.framework.TestCase.runTest(TestCase.java:176)
        at junit.framework.TestCase.runBare(TestCase.java:141)
        at junit.framework.TestResult$1.protect(TestResult.java:122)
        at junit.framework.TestResult.runProtected(TestResult.java:142)
        at junit.framework.TestResult.run(TestResult.java:125)
        at junit.framework.TestCase.run(TestCase.java:129)
        at junit.framework.TestSuite.runTest(TestSuite.java:255)
        at junit.framework.TestSuite.run(TestSuite.java:250)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at junit.textui.TestRunner.start(TestRunner.java:183)
        at junit.textui.TestRunner.main(TestRunner.java:137)
        at org.apache.pdfbox.util.TestPDFToImage.main(TestPDFToImage.java:382)
Caused by: java.io.EOFException
        at 
org.apache.fontbox.ttf.TTFDataStream.readUnsignedInt(TTFDataStream.java:134)
        at 
org.apache.fontbox.ttf.IndexToLocationTable.read(IndexToLocationTable.java:58)
        at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:285)
        at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:142)
        at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:122)
        at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:96)
        at 
org.apache.pdfbox.pdmodel.font.PDCIDFontType2.<init>(PDCIDFontType2.java:72)
        ... 32 more
{code}

> Remove usage of AWT fonts
> -------------------------
>
>                 Key: PDFBOX-2262
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2262
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel, Rendering
>    Affects Versions: 2.0.0
>            Reporter: John Hewson
>            Assignee: John Hewson
>         Attachments: Basiswissen-Vorschriften.pdf, 
> Basiswissen-Vorschriften.pdf-1.png, 
> Basiswissen-Vorschriften.pdf-1.png-diff.png, 
> Basiswissen-Vorschriften.pdf-9.png, 
> Basiswissen-Vorschriften.pdf-9.png-diff.png, 
> ELVIA-Reiserucktritt-Vollschutz.pdf-1.png, FreeSansTest.pdf, 
> PDFBOX-1094-094730.pdf-1.png, PDFBOX-1770.pdf-1.png, 
> bugzilla867751.pdf-2.png, bugzilla867751.pdf-2.png-diff.png, 
> bugzilla886049.pdf, bugzilla886049.pdf-1.png, test_1fd9a_test.pdf
>
>
> We're still using AWT fonts to render the "standard 14" built-in fonts, which 
> causes rendering problems and encoding issues (see  PDFBOX-2140). We're also 
> using AWT for some fallback fonts.
> Removal of these AWT fonts isn't too difficult, we need to load the fonts 
> using the existing PDFFontManager mechanism which has recently been added. 
> All missing TrueType fonts loaded from disk have been using SystemFontManager 
> for a number of weeks now. 
> We should ship some sensible default fonts with PDFBox, such as the 
> Liberation fonts (see PDFBOX-2169, PDFBOX-2263), in case PDFFontManager can't 
> find anything suitable, rather than falling back to the default TTF font, but 
> by default we'll probe the system for suitable fonts.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to