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

Daniel Brownell commented on PDFBOX-2665:
-----------------------------------------

Here's the error from the latest one:

Error: java.lang.NullPointerException
        at 
org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:309) 
[pdfbox-2.0.0-20150204.015951-1042.jar:2.0.0-SNAPSHOT]
        at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:268) 
[pdfbox-2.0.0-20150204.015951-1042.jar:2.0.0-SNAPSHOT]
        at 
org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:297) 
[pdfbox-2.0.0-20150204.015951-1042.jar:2.0.0-SNAPSHOT]

Here is the line it happens on:

float width = font.getStringWidth(text.substring(start,i)) / 1000 * (fontSize);

where I define:
protected PDType1Font font = PDType1Font.TIMES_ROMAN;



> PDType1Font (HELVETICA) encode getting NullPointerException
> -----------------------------------------------------------
>
>                 Key: PDFBOX-2665
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2665
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.0
>         Environment: Win 7, JDK 7, JBoss AS 7
>            Reporter: Daniel Brownell
>            Assignee: John Hewson
>
> Hi,
> I have been trying to revert to previous pdfbox-2.0.0 versions, which is why 
> the error is from a previous build, but this is applicable to the latest 
> (2.0.0-20150204.015951-1042) too.
> I am getting this error, which I was not getting a month ago.
> Regards...
> Error: java.lang.NullPointerException
>       at 
> org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:309) 
> [pdfbox-2.0.0-20150129.080600-1013.jar:2.0.0-SNAPSHOT]
>       at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:267) 
> [pdfbox-2.0.0-20150129.080600-1013.jar:2.0.0-SNAPSHOT]
>       at 
> org.apache.pdfbox.pdmodel.PDPageContentStream.showText(PDPageContentStream.java:316)
>  [pdfbox-2.0.0-20150129.080600-1013.jar:2.0.0-SNAPSHOT]



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to