You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "Swaminathan, Natarajan" <ns...@wmata.com> on 2013/03/19 20:29:27 UTC

issue with loadTTF

Hello,

I tried to load the attached TTF using the following code.....

      document = new PDDocument() ;/*PDDocument.load(pdfFile);*/
      PDFont font = PDTrueTypeFont.loadTTF(document, "FREE3OF9.TTF" );

I got the following error:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 42
                at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadDescriptorDictionary(PDTrueTypeFont.java:406)
                at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:198)
                at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:174)
                at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:155)
                at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:142)
                at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:129)
                at test.Test.printUsingPDFBox(Test.java:212)
                at test.Test.main(Test.java:246)


I did some research and found an existing bug with similar symptoms.

https://issues.apache.org/jira/browse/PDFBOX-1335?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab

Anyone have any fixes or workarounds that I can use?

Thanks,
Swami.


Re: issue with loadTTF

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
can you test using the latest trunk version? Seems to have resolved the issue.

with kind regards

Maruan Sahyoun

Am 19.03.2013 um 20:29 schrieb "Swaminathan, Natarajan" <ns...@wmata.com>:

> Hello,
>  
> I tried to load the attached TTF using the following codeā€¦..
>  
>       document = new PDDocument() ;/*PDDocument.load(pdfFile);*/
>       PDFont font = PDTrueTypeFont.loadTTF(document, "FREE3OF9.TTF" );
>  
> I got the following error:
>  
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 42
>                 at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadDescriptorDictionary(PDTrueTypeFont.java:406)
>                 at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:198)
>                 at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:174)
>                 at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:155)
>                 at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:142)
>                 at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:129)
>                 at test.Test.printUsingPDFBox(Test.java:212)
>                 at test.Test.main(Test.java:246)
>  
>  
> I did some research and found an existing bug with similar symptoms.
>  
> https://issues.apache.org/jira/browse/PDFBOX-1335?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab
>  
> Anyone have any fixes or workarounds that I can use?
>  
> Thanks,
> Swami.
>