You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Luis Julian <lj...@tonesoft.com> on 2025/11/26 21:21:23 UTC
PDFBox Image
Hello,
PDFBox is a great piece of software. We've been using PDFBox 3.0.5 to convert some PDFs to images. It's been working well but we've encountered the following error message for one of our PDFs:
Exception in thread "main" java.io.IOException: Type 2 descendant font not allowed
:at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:105)
:at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:171)
:at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:66)
:at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:980)
:at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:555)
:at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:530)
:at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
:at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:288)
:at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355)
:at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272)
:at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
:at org.apache.pdfbox.tools.PDFToImage.main(PDFToImage.java:262)
:at org.apache.pdfbox.tools.PDFBox.main(PDFBox.java:93)
Looking at the PDF, the issue seems to be that we're using the Type 2 CIDFont directly instead of having it be a descendant of a Type 0 font.
We are able to display the pdf in a variety of different PDF viewers, like Chrome PDF viewer. It seems that the PDF viewers are more relaxed with how fonts are used compared to the PDF specification. Is it possible to have PDFBox be less strict and process this type of PDF either through a configuration setting or programmatically? It would be great if PDFBox was more flexible like many PDF viewers.
Thank you,
Luis
Re: PDFBox Image
Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,
Adobe Reader doesn't like that file:
Why don't you ask that vendor ( https://www.tonesoft.com/jes2mail ) to
fix their product?
Tilman
Am 26.11.2025 um 23:27 schrieb Luis Julian:
> Yes we created the PDF with a program.
>
> The PDF should be accessible here:
> https://drive.google.com/file/d/1AfRuSitknlaEqadNC3fDmecCBQX5WuIO/view?usp=sharing
>
> Thank you,
> Luis
> ________________________________
> From: Tilman Hausherr<TH...@t-online.de>
> Sent: Wednesday, November 26, 2025 1:23 PM
> To:users@pdfbox.apache.org <us...@pdfbox.apache.org>
> Subject: Re: PDFBox Image
>
> Hi,
> Please upload your file to a sharehoster.
> Did you or your team / your company create that file?
> Tilman
>
> Am 26.11.2025 um 22:21 schrieb Luis Julian:
>> Hello,
>>
>> PDFBox is a great piece of software. We've been using PDFBox 3.0.5 to convert some PDFs to images. It's been working well but we've encountered the following error message for one of our PDFs:
>> Exception in thread "main" java.io.IOException: Type 2 descendant font not allowed
>> :at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:105)
>> :at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:171)
>> :at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:66)
>> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:980)
>> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:555)
>> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:530)
>> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
>> :at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:288)
>> :at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355)
>> :at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272)
>> :at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
>> :at org.apache.pdfbox.tools.PDFToImage.main(PDFToImage.java:262)
>> :at org.apache.pdfbox.tools.PDFBox.main(PDFBox.java:93)
>>
>> Looking at the PDF, the issue seems to be that we're using the Type 2 CIDFont directly instead of having it be a descendant of a Type 0 font.
>>
>> We are able to display the pdf in a variety of different PDF viewers, like Chrome PDF viewer. It seems that the PDF viewers are more relaxed with how fonts are used compared to the PDF specification. Is it possible to have PDFBox be less strict and process this type of PDF either through a configuration setting or programmatically? It would be great if PDFBox was more flexible like many PDF viewers.
>>
>> Thank you,
>> Luis
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail:users-help@pdfbox.apache.org
>
>
Re: PDFBox Image
Posted by Luis Julian <lj...@tonesoft.com>.
Yes we created the PDF with a program.
The PDF should be accessible here:
https://drive.google.com/file/d/1AfRuSitknlaEqadNC3fDmecCBQX5WuIO/view?usp=sharing
Thank you,
Luis
________________________________
From: Tilman Hausherr <TH...@t-online.de>
Sent: Wednesday, November 26, 2025 1:23 PM
To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Subject: Re: PDFBox Image
Hi,
Please upload your file to a sharehoster.
Did you or your team / your company create that file?
Tilman
Am 26.11.2025 um 22:21 schrieb Luis Julian:
> Hello,
>
> PDFBox is a great piece of software. We've been using PDFBox 3.0.5 to convert some PDFs to images. It's been working well but we've encountered the following error message for one of our PDFs:
> Exception in thread "main" java.io.IOException: Type 2 descendant font not allowed
> :at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:105)
> :at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:171)
> :at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:66)
> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:980)
> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:555)
> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:530)
> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
> :at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:288)
> :at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355)
> :at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272)
> :at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
> :at org.apache.pdfbox.tools.PDFToImage.main(PDFToImage.java:262)
> :at org.apache.pdfbox.tools.PDFBox.main(PDFBox.java:93)
>
> Looking at the PDF, the issue seems to be that we're using the Type 2 CIDFont directly instead of having it be a descendant of a Type 0 font.
>
> We are able to display the pdf in a variety of different PDF viewers, like Chrome PDF viewer. It seems that the PDF viewers are more relaxed with how fonts are used compared to the PDF specification. Is it possible to have PDFBox be less strict and process this type of PDF either through a configuration setting or programmatically? It would be great if PDFBox was more flexible like many PDF viewers.
>
> Thank you,
> Luis
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: PDFBox Image
Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,
Please upload your file to a sharehoster.
Did you or your team / your company create that file?
Tilman
Am 26.11.2025 um 22:21 schrieb Luis Julian:
> Hello,
>
> PDFBox is a great piece of software. We've been using PDFBox 3.0.5 to convert some PDFs to images. It's been working well but we've encountered the following error message for one of our PDFs:
> Exception in thread "main" java.io.IOException: Type 2 descendant font not allowed
> :at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:105)
> :at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:171)
> :at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:66)
> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:980)
> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:555)
> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:530)
> :at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
> :at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:288)
> :at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355)
> :at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:272)
> :at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:258)
> :at org.apache.pdfbox.tools.PDFToImage.main(PDFToImage.java:262)
> :at org.apache.pdfbox.tools.PDFBox.main(PDFBox.java:93)
>
> Looking at the PDF, the issue seems to be that we're using the Type 2 CIDFont directly instead of having it be a descendant of a Type 0 font.
>
> We are able to display the pdf in a variety of different PDF viewers, like Chrome PDF viewer. It seems that the PDF viewers are more relaxed with how fonts are used compared to the PDF specification. Is it possible to have PDFBox be less strict and process this type of PDF either through a configuration setting or programmatically? It would be great if PDFBox was more flexible like many PDF viewers.
>
> Thank you,
> Luis
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org