You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Graham Matthews <gr...@orangedogsoftware.com> on 2013/09/09 20:10:53 UTC

strange font problem -- I think

Hi

Attached is a PDF that renders strangely with PDFBox when converting to an image. The dots come out as little vertical lines.

I am on OS X using PDFBox 1.8.2.

I suspect the issue is that the Dingbats font isn't loaded for some reason. I tried to get the Dingbats font set loaded into my document as follows

		pdf = PDDocument.load(fileName);
		 PDTrueTypeFont.loadTTF(pdf, font.openStream());

where:

- fileName is the attached PDF file
- font is a URL to my ZapDingbats.ttf file (I tried it both ways using resource loading and an explicit path to the the file)

This call causes the following error

java.lang.NullPointerException
	at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadDescriptorDictionary(PDTrueTypeFont.java:409)
	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)


I am wondering if this is a bug, or have i missed something obvious?

thanks
graham



Re: strange font problem -- I think

Posted by Andreas Lehmkühler <an...@lehmi.de>.
Hi,

> Graham Matthews <gr...@orangedogsoftware.com> hat am 9. September 2013 um
> 20:10 geschrieben:
>
>
> Hi
>
> Attached is a PDF that renders strangely with PDFBox when converting to an
> image. The dots come out as little vertical lines.
Your pdf didn't make it due to some restirctions to the mailing list.

> I am on OS X using PDFBox 1.8.2.
>
> I suspect the issue is that the Dingbats font isn't loaded for some reason. I
> tried to get the Dingbats font set loaded into my document as follows
>
>            pdf = PDDocument.load(fileName);
>             PDTrueTypeFont.loadTTF(pdf, font.openStream());
>
> where:
>
> - fileName is the attached PDF file
> - font is a URL to my ZapDingbats.ttf file (I tried it both ways using
> resource loading and an explicit path to the the file)
It's not possible to load missing fonts afterwards

> This call causes the following error
>
> java.lang.NullPointerException
>    at
>org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.loadDescriptorDictionary(PDTrueTypeFont.java:409)
>    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)
>
>
> I am wondering if this is a bug, or have i missed something obvious?
I guess the font is embbeded and can't be loaded because of an known issue [1].
It's solved and will be part of our next major release, which isn't yet
scheduled.

> thanks
> graham

BR
Andreas Lehmkühler

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