You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Esteban R <er...@hotmail.com> on 2019/11/29 19:31:39 UTC

NullPointerException in PDSimpleFont.isStandard14()

I get a NullPointerException while trying to find out if a particular font is "Standard14":

Exception in thread "main" java.lang.NullPointerException
        at org.apache.pdfbox.pdmodel.font.PDSimpleFont.isStandard14(PDSimpleFont.java:377)
        at com.itesoft.pdfapi.cmdline.TestIsStandard14Font.main(TestIsStandard14Font.java:24)

Code:
    public static void main(String[] args) throws IOException {
        PDDocument d = PDDocument.load(new File(args[0]));
        PDPage p = d.getPage(0);
        PDFont f = p.getResources().getFont(COSName.getPDFName("Font0"));
        f.isStandard14(); //Exception here
    }

Sample file (simplification of a real-life example):
http://ge.tt/6FV9vmz2

There is something wrong with this font or it is an issue in pdfbox?

Esteban Ruiz

RE: NullPointerException in PDSimpleFont.isStandard14()

Posted by Esteban R <er...@hotmail.com>.
Ok. Thanks!

Esteban
________________________________
De: Tilman Hausherr <TH...@t-online.de>
Enviado: sábado, 30 de noviembre de 2019 04:14
Para: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Asunto: Re: NullPointerException in PDSimpleFont.isStandard14()

Hi,
This was fixed but not yet released:
https://issues.apache.org/jira/browse/PDFBOX-4682
Until then, check that the font is not type 3 before calling
isStandard14().
Tilman

Am 29.11.2019 um 20:31 schrieb Esteban R:
> I get a NullPointerException while trying to find out if a particular font is "Standard14":
>
> Exception in thread "main" java.lang.NullPointerException
>          at org.apache.pdfbox.pdmodel.font.PDSimpleFont.isStandard14(PDSimpleFont.java:377)
>          at com.itesoft.pdfapi.cmdline.TestIsStandard14Font.main(TestIsStandard14Font.java:24)
>
> Code:
>      public static void main(String[] args) throws IOException {
>          PDDocument d = PDDocument.load(new File(args[0]));
>          PDPage p = d.getPage(0);
>          PDFont f = p.getResources().getFont(COSName.getPDFName("Font0"));
>          f.isStandard14(); //Exception here
>      }
>
> Sample file (simplification of a real-life example):
> http://ge.tt/6FV9vmz2
>
> There is something wrong with this font or it is an issue in pdfbox?
>
> Esteban Ruiz
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: NullPointerException in PDSimpleFont.isStandard14()

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,
This was fixed but not yet released:
https://issues.apache.org/jira/browse/PDFBOX-4682
Until then, check that the font is not type 3 before calling 
isStandard14().
Tilman

Am 29.11.2019 um 20:31 schrieb Esteban R:
> I get a NullPointerException while trying to find out if a particular font is "Standard14":
>
> Exception in thread "main" java.lang.NullPointerException
>          at org.apache.pdfbox.pdmodel.font.PDSimpleFont.isStandard14(PDSimpleFont.java:377)
>          at com.itesoft.pdfapi.cmdline.TestIsStandard14Font.main(TestIsStandard14Font.java:24)
>
> Code:
>      public static void main(String[] args) throws IOException {
>          PDDocument d = PDDocument.load(new File(args[0]));
>          PDPage p = d.getPage(0);
>          PDFont f = p.getResources().getFont(COSName.getPDFName("Font0"));
>          f.isStandard14(); //Exception here
>      }
>
> Sample file (simplification of a real-life example):
> http://ge.tt/6FV9vmz2
>
> There is something wrong with this font or it is an issue in pdfbox?
>
> Esteban Ruiz
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org