You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Sean <se...@gmail.com> on 2013/08/26 20:49:51 UTC

PDF page to image with embedded fonts

Hello!

I have found an issue converting PDF pages to an image with using embedded
font. From what I can gather this is a known issue.

I have used 1.8.3 and 1.9.0
The error in the log is:
2013-08-26 11:15:32.897 -0700 Can't read the embedded font [font name here]
2013-08-26 11:15:32.897 -0700 Using font Helvetica-Light instead of [font
name here]


I found this post describing the problem:
https://issues.apache.org/jira/browse/PDFBOX-1436

A Tilman Hausherr wrote "...works with 2.0.0 as of yesterday."

Thats awesome but it would seem that 2.0.0 either doesn't have
convertToImage implemented
yet or it's been removed.

Are there any workarounds with either the current release or 2.0 to convert
a PDF with embedded fonts to an image?

Re: PDF page to image with embedded fonts

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

> Sean <se...@gmail.com> hat am 26. August 2013 um 23:01 geschrieben:
>
>
> Andreas, one more thing. It looks like RenderUtil.convertToImage is
> either broken or unfinished(?)
Nope, it works.

> java.lang.NoSuchMethodError:
> org.apache.pdfbox.pdfviewer.PageDrawer.dispose()V
> org.apache.pdfbox.util.RenderUtil.renderPage(RenderUtil.java:214)
> org.apache.pdfbox.util.RenderUtil.convertToImage(RenderUtil.java:177)
>
Looks like you didn't update the whole source code/all maven dependencies of
PDFBox, did you?
It ist not sufficient to simply add the new RenderUtil class to your source.

>
> Thanks again very much,
> Sean
>
> On Mon, Aug 26, 2013 at 1:53 PM, Sean <se...@gmail.com> wrote:
> >
> > Thanks for the reply Andreas. To answer you question about 1.9 I should
> > first tell you that I'm relatively new to Java and Maven projects. I'm using
> > Netbeans and thought I would change the version tag and it auto filled in
> > 1.9.0-SNAPSHOT and it worked.
> >
> > <dependency>
> >    <groupId>org.apache.pdfbox</groupId>
> >    <artifactId>pdfbox</artifactId>
> >    <version>1.9.0-SNAPSHOT</version>
> > </dependency>
> >
> >
> > On Mon, Aug 26, 2013 at 1:39 PM, Andreas Lehmkuehler <an...@lehmi.de>
> > wrote:
> >>
> >> Hi,
> >>
> >> Am 26.08.2013 20:49, schrieb Sean:
> >>
> >>> Hello!
> >>>
> >>> I have found an issue converting PDF pages to an image with using
> >>> embedded
> >>> font. From what I can gather this is a known issue.
> >>>
> >>> I have used 1.8.3 and 1.9.0
> >>
> >> I'm just curious, where did you get 1.9.0 ? Can't be an offical release
> >>
> >>
> >>> The error in the log is:
> >>> 2013-08-26 11:15:32.897 -0700 Can't read the embedded font [font name
> >>> here]
> >>> 2013-08-26 11:15:32.897 -0700 Using font Helvetica-Light instead of [font
> >>> name here]
> >>>
> >>>
> >>> I found this post describing the problem:
> >>> https://issues.apache.org/jira/browse/PDFBOX-1436
> >>>
> >>> A Tilman Hausherr wrote "...works with 2.0.0 as of yesterday."
> >>>
> >>> Thats awesome but it would seem that 2.0.0 either doesn't have
> >>> convertToImage implemented
> >>> yet or it's been removed.
> >>>
> >>> Are there any workarounds with either the current release or 2.0 to
> >>> convert
> >>> a PDF with embedded fonts to an image?
> >>
> >> We are refactoring some parts of PDFBox. convertToImage was moved to
> >>
> >> org.apache.pdfbox.util.RenderUtil
> >>
> >> BR
> >> Andreas Lehmkühler
> >
> >

BR
Andreas Lehmkühler

Re: PDF page to image with embedded fonts

Posted by Sean <se...@gmail.com>.
Andreas, one more thing. It looks like RenderUtil.convertToImage is
either broken or unfinished(?)

java.lang.NoSuchMethodError:
org.apache.pdfbox.pdfviewer.PageDrawer.dispose()V
org.apache.pdfbox.util.RenderUtil.renderPage(RenderUtil.java:214)
org.apache.pdfbox.util.RenderUtil.convertToImage(RenderUtil.java:177)


Thanks again very much,
Sean

On Mon, Aug 26, 2013 at 1:53 PM, Sean <se...@gmail.com> wrote:
>
> Thanks for the reply Andreas. To answer you question about 1.9 I should
> first tell you that I'm relatively new to Java and Maven projects. I'm using
> Netbeans and thought I would change the version tag and it auto filled in
> 1.9.0-SNAPSHOT and it worked.
>
> <dependency>
>    <groupId>org.apache.pdfbox</groupId>
>    <artifactId>pdfbox</artifactId>
>    <version>1.9.0-SNAPSHOT</version>
> </dependency>
>
>
> On Mon, Aug 26, 2013 at 1:39 PM, Andreas Lehmkuehler <an...@lehmi.de>
> wrote:
>>
>> Hi,
>>
>> Am 26.08.2013 20:49, schrieb Sean:
>>
>>> Hello!
>>>
>>> I have found an issue converting PDF pages to an image with using
>>> embedded
>>> font. From what I can gather this is a known issue.
>>>
>>> I have used 1.8.3 and 1.9.0
>>
>> I'm just curious, where did you get 1.9.0 ? Can't be an offical release
>>
>>
>>> The error in the log is:
>>> 2013-08-26 11:15:32.897 -0700 Can't read the embedded font [font name
>>> here]
>>> 2013-08-26 11:15:32.897 -0700 Using font Helvetica-Light instead of [font
>>> name here]
>>>
>>>
>>> I found this post describing the problem:
>>> https://issues.apache.org/jira/browse/PDFBOX-1436
>>>
>>> A Tilman Hausherr wrote "...works with 2.0.0 as of yesterday."
>>>
>>> Thats awesome but it would seem that 2.0.0 either doesn't have
>>> convertToImage implemented
>>> yet or it's been removed.
>>>
>>> Are there any workarounds with either the current release or 2.0 to
>>> convert
>>> a PDF with embedded fonts to an image?
>>
>> We are refactoring some parts of PDFBox. convertToImage was moved to
>>
>> org.apache.pdfbox.util.RenderUtil
>>
>> BR
>> Andreas Lehmkühler
>
>

Re: PDF page to image with embedded fonts

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

> Sean <se...@gmail.com> hat am 26. August 2013 um 22:53 geschrieben:
>
>
> Thanks for the reply Andreas. To answer you question about 1.9 I should
> first tell you that I'm relatively new to Java and Maven projects. I'm
> using Netbeans and thought I would change the version tag and it auto
> filled in 1.9.0-SNAPSHOT and it worked.
>
> <dependency>
>     <groupId>org.apache.pdfbox</groupId>
>     <artifactId>pdfbox</artifactId>
>     <version>1.9.0-SNAPSHOT</version>
> </dependency>
>
Ah, ok I see. That version went into the maven repos by accident. We never
intended to release such a version.
If you are using a SNAPSHOT-version you should use 2.0.0-SNAPSHOT

> On Mon, Aug 26, 2013 at 1:39 PM, Andreas Lehmkuehler <an...@lehmi.de>wrote:
>
> > Hi,
> >
> > Am 26.08.2013 20:49, schrieb Sean:
> >
> >  Hello!
> >>
> >> I have found an issue converting PDF pages to an image with using embedded
> >> font. From what I can gather this is a known issue.
> >>
> >> I have used 1.8.3 and 1.9.0
> >>
> > I'm just curious, where did you get 1.9.0 ? Can't be an offical release
> >
> >
> >  The error in the log is:
> >> 2013-08-26 11:15:32.897 -0700 Can't read the embedded font [font name
> >> here]
> >> 2013-08-26 11:15:32.897 -0700 Using font Helvetica-Light instead of [font
> >> name here]
> >>
> >>
> >> I found this post describing the problem:
> >> https://issues.apache.org/**jira/browse/PDFBOX-1436<https://issues.apache.org/jira/browse/PDFBOX-1436>
> >>
> >> A Tilman Hausherr wrote "...works with 2.0.0 as of yesterday."
> >>
> >> Thats awesome but it would seem that 2.0.0 either doesn't have
> >> convertToImage implemented
> >> yet or it's been removed.
> >>
> >> Are there any workarounds with either the current release or 2.0 to
> >> convert
> >> a PDF with embedded fonts to an image?
> >>
> > We are refactoring some parts of PDFBox. convertToImage was moved to
> >
> > org.apache.pdfbox.util.**RenderUtil
> >
> > BR
> > Andreas Lehmkühler
> >

BR
Andreas Lehmkühler

Re: PDF page to image with embedded fonts

Posted by Sean <se...@gmail.com>.
Thanks for the reply Andreas. To answer you question about 1.9 I should
first tell you that I'm relatively new to Java and Maven projects. I'm
using Netbeans and thought I would change the version tag and it auto
filled in 1.9.0-SNAPSHOT and it worked.

<dependency>
    <groupId>org.apache.pdfbox</groupId>
    <artifactId>pdfbox</artifactId>
    <version>1.9.0-SNAPSHOT</version>
</dependency>


On Mon, Aug 26, 2013 at 1:39 PM, Andreas Lehmkuehler <an...@lehmi.de>wrote:

> Hi,
>
> Am 26.08.2013 20:49, schrieb Sean:
>
>  Hello!
>>
>> I have found an issue converting PDF pages to an image with using embedded
>> font. From what I can gather this is a known issue.
>>
>> I have used 1.8.3 and 1.9.0
>>
> I'm just curious, where did you get 1.9.0 ? Can't be an offical release
>
>
>  The error in the log is:
>> 2013-08-26 11:15:32.897 -0700 Can't read the embedded font [font name
>> here]
>> 2013-08-26 11:15:32.897 -0700 Using font Helvetica-Light instead of [font
>> name here]
>>
>>
>> I found this post describing the problem:
>> https://issues.apache.org/**jira/browse/PDFBOX-1436<https://issues.apache.org/jira/browse/PDFBOX-1436>
>>
>> A Tilman Hausherr wrote "...works with 2.0.0 as of yesterday."
>>
>> Thats awesome but it would seem that 2.0.0 either doesn't have
>> convertToImage implemented
>> yet or it's been removed.
>>
>> Are there any workarounds with either the current release or 2.0 to
>> convert
>> a PDF with embedded fonts to an image?
>>
> We are refactoring some parts of PDFBox. convertToImage was moved to
>
> org.apache.pdfbox.util.**RenderUtil
>
> BR
> Andreas Lehmkühler
>

Re: PDF page to image with embedded fonts

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 26.08.2013 20:49, schrieb Sean:
> Hello!
>
> I have found an issue converting PDF pages to an image with using embedded
> font. From what I can gather this is a known issue.
>
> I have used 1.8.3 and 1.9.0
I'm just curious, where did you get 1.9.0 ? Can't be an offical release

> The error in the log is:
> 2013-08-26 11:15:32.897 -0700 Can't read the embedded font [font name here]
> 2013-08-26 11:15:32.897 -0700 Using font Helvetica-Light instead of [font
> name here]
>
>
> I found this post describing the problem:
> https://issues.apache.org/jira/browse/PDFBOX-1436
>
> A Tilman Hausherr wrote "...works with 2.0.0 as of yesterday."
>
> Thats awesome but it would seem that 2.0.0 either doesn't have
> convertToImage implemented
> yet or it's been removed.
>
> Are there any workarounds with either the current release or 2.0 to convert
> a PDF with embedded fonts to an image?
We are refactoring some parts of PDFBox. convertToImage was moved to

org.apache.pdfbox.util.RenderUtil

BR
Andreas Lehmkühler