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

Tilman Hausherr edited comment on PDFBOX-2245 at 7/26/14 8:04 PM:
------------------------------------------------------------------

Fixed in rev 1613708 for the trunk.


was (Author: tilman):
Fixed in rev 161370 for the trunk.

> java.lang.StringIndexOutOfBoundsException in 
> PDTrueTypeFont.getGIDForCharacterCode
> ----------------------------------------------------------------------------------
>
>                 Key: PDFBOX-2245
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2245
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.0
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>             Fix For: 2.0.0
>
>         Attachments: PDFBOX-2245-052567.pdf
>
>
> I get this exception with the attached file:
> {code}
> java.lang.StringIndexOutOfBoundsException: String index out of range: 0
>         at java.lang.String.codePointAt(Unknown Source)
>         at 
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getGIDForCharacterCode(PDTrueTypeFont.java:452)
>         at 
> org.apache.pdfbox.rendering.font.TTFGlyph2D.getGIDForCharacterCode(TTFGlyph2D.java:178)
>         at 
> org.apache.pdfbox.rendering.font.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:150)
>         at 
> org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:354)
>         at 
> org.apache.pdfbox.rendering.PageDrawer.processGlyph(PageDrawer.java:325)
> {code}
> The cause is that Encoding.getCharacterForName(characterName) returns an 
> empty string. This is because characterName is ".notdef". Adobe Reader 
> displays a gap. This can be seen at "Alumni   Weekend" and "health    
> professions". A copy & paste into an editor shows that Adobe returns a hex 1 
> code. My change ignores the wrong code, outputs an error message and the file 
> renders like in adobe reader.



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

Reply via email to