pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkuehler <andr...@lehmi.de>
Subject Re: Hello World using a TrueType font ArrayIndexOutOfBoundsException
Date Mon, 15 Jul 2013 18:20:05 GMT

Am 15.07.2013 14:47, schrieb Duncan.Horrocks@sungard.com:
> Hi,
> The small example "Hello World using a TrueType font" on the pdfbox website does not
work when selecting the Windows font "cour.ttf" (Courier New). It works with the non-fixed
width fonts that I have tried (Arial, Albertus, Bookman Old Style, Garamond, Palatino, Segoe
UI) and it works with Lucida Console, a fixed width font, but not Courier New.
> This is the error:
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
>          at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadDescriptorDictionary(PDTrueTypeFont.java:418)
>          at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:201)
>          at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:177)
>          at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:158)
>          at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:145)
>          at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadTTF(PDTrueTypeFont.java:132)
>          at pdfbox_ttf_test.Main.main(Main.java:31)
> To me this is the same error as PDFBOX-1335, except maybe it is still not fixed for all
It's the same method but not the same line. There is an issue with the width of
each glyph. PDFBox assumes a single value for each glyph, but the monospaced
don't have to provide such values. It's sufficient to deliver one for all
Please file an issue on JIRA [1] with the description from your mail.

> I am using Windows 7 SP1 32-bit, pdfbox 1.8.2., NetBeans IDE 6.9.1
> This is my source:

Thanks in advance
Andreas Lehmkühler

[1] https://issues.apache.org/jira/browse/PDFBOX

View raw message