You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Eric Douglas <ed...@blockhouse.com> on 2011/09/12 21:54:07 UTC

RE: How to make embedded font readable?

I'll look into that JIRA, thanks.
The pdfbox error in the original message below shows the class and method producing this message in the Java log.

Digging a little deeper, this is caused by the pdfbox method:
org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary.getFontFile2()

This is trying to read the "FontFile2" key which was written by FOP.
org.apache.fop.pdf.PDFFontDescriptor.setFontFile()

One of these is missing something.
 
 

-----Original Message-----
From: Andreas Lehmkuehler [mailto:andreas@lehmi.de] 
Sent: Monday, September 12, 2011 3:30 PM
To: users@pdfbox.apache.org
Cc: fop-users@xmlgraphics.apache.org
Subject: Re: How to make embedded font readable?

Hi,

Am 12.09.2011 15:31, schrieb Eric Douglas:
> FOP created the PDF.  Pdfbox is trying to read it.
> I'm not sure which end is missing what.
> I'm embedding fonts and pdfbox says there's something there it can't 
> read.
I guess it is an issue with PDFBox, but without a sample PDF it's only a guess. 
Please create an issue on JIRA [1] and attach a sample pdf to it.

> Sep 12, 2011 9:18:12 AM
> org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
> INFO: Can't read the embedded font EAAAAD+LucidaSans-Typewriter


BR
Andreas Lehmkühler

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

RE: How to make embedded font readable?

Posted by Dr Stev <st...@sio.midco.net>.
I have had problems reading and using PDF files that were created in
another application and using embedded fonts.  My simple matter was to
print these PDFs.  But there was always a font substitution used by
pdfbox that really did not work for me.

I think there is an open issue regarding this and it would be nice to
see it resolved.  If I remember right the problem was related to an
incomplete font descriptor or maybe the whole font library wasn't there.

I have had to use another library to print PDFs but I don't like it.  It
is not as finished as this library.  But at least it knows how to use
the font library that is embedded in the PDF.

On Mon, 2011-09-12 at 15:54 -0400, Eric Douglas wrote:
> I'll look into that JIRA, thanks.
> The pdfbox error in the original message below shows the class and method producing this message in the Java log.
> 
> Digging a little deeper, this is caused by the pdfbox method:
> org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary.getFontFile2()
> 
> This is trying to read the "FontFile2" key which was written by FOP.
> org.apache.fop.pdf.PDFFontDescriptor.setFontFile()
> 
> One of these is missing something.
>  
> 
> 
> -----Original Message-----
> From: Andreas Lehmkuehler [mailto:andreas@lehmi.de] 
> Sent: Monday, September 12, 2011 3:30 PM
> To: users@pdfbox.apache.org
> Cc: fop-users@xmlgraphics.apache.org
> Subject: Re: How to make embedded font readable?
> 
> Hi,
> 
> Am 12.09.2011 15:31, schrieb Eric Douglas:
> > FOP created the PDF.  Pdfbox is trying to read it.
> > I'm not sure which end is missing what.
> > I'm embedding fonts and pdfbox says there's something there it can't 
> > read.
> I guess it is an issue with PDFBox, but without a sample PDF it's only a guess. 
> Please create an issue on JIRA [1] and attach a sample pdf to it.
> 
> > Sep 12, 2011 9:18:12 AM
> > org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
> > INFO: Can't read the embedded font EAAAAD+LucidaSans-Typewriter
> 
> 
> BR
> Andreas Lehmkühler
> 
> [1] https://issues.apache.org/jira/browse/PDFBOX
> 



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


RE: How to make embedded font readable?

Posted by Dr Stev <st...@sio.midco.net>.
I have had problems reading and using PDF files that were created in
another application and using embedded fonts.  My simple matter was to
print these PDFs.  But there was always a font substitution used by
pdfbox that really did not work for me.

I think there is an open issue regarding this and it would be nice to
see it resolved.  If I remember right the problem was related to an
incomplete font descriptor or maybe the whole font library wasn't there.

I have had to use another library to print PDFs but I don't like it.  It
is not as finished as this library.  But at least it knows how to use
the font library that is embedded in the PDF.

On Mon, 2011-09-12 at 15:54 -0400, Eric Douglas wrote:
> I'll look into that JIRA, thanks.
> The pdfbox error in the original message below shows the class and method producing this message in the Java log.
> 
> Digging a little deeper, this is caused by the pdfbox method:
> org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary.getFontFile2()
> 
> This is trying to read the "FontFile2" key which was written by FOP.
> org.apache.fop.pdf.PDFFontDescriptor.setFontFile()
> 
> One of these is missing something.
>  
> 
> 
> -----Original Message-----
> From: Andreas Lehmkuehler [mailto:andreas@lehmi.de] 
> Sent: Monday, September 12, 2011 3:30 PM
> To: users@pdfbox.apache.org
> Cc: fop-users@xmlgraphics.apache.org
> Subject: Re: How to make embedded font readable?
> 
> Hi,
> 
> Am 12.09.2011 15:31, schrieb Eric Douglas:
> > FOP created the PDF.  Pdfbox is trying to read it.
> > I'm not sure which end is missing what.
> > I'm embedding fonts and pdfbox says there's something there it can't 
> > read.
> I guess it is an issue with PDFBox, but without a sample PDF it's only a guess. 
> Please create an issue on JIRA [1] and attach a sample pdf to it.
> 
> > Sep 12, 2011 9:18:12 AM
> > org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
> > INFO: Can't read the embedded font EAAAAD+LucidaSans-Typewriter
> 
> 
> BR
> Andreas Lehmkühler
> 
> [1] https://issues.apache.org/jira/browse/PDFBOX
> 



Re: How to make embedded font readable?

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

Am 13.09.2011 17:14, schrieb Martin Haberstroh:
> Can someone tell me how to unsubscribe from this email distribution?  I have tried the unsubscribe process several times on the site but it does not work.
> Thanks.
As described at [1] send an email to users-unsubscribe@pdfbox.apache.org using 
the emailaddress to be unsubscribed.


BR
Andreas Lehmkühler

[1] http://pdfbox.apache.org/mail-lists.html

>
>
>
> ________________________________
> From: Andreas Lehmkuehler<an...@lehmi.de>
> To: users@pdfbox.apache.org
> Sent: Monday, September 12, 2011 11:15 PM
> Subject: Re: How to make embedded font readable?
>
> Hi,
>
> Am 12.09.2011 21:54, schrieb Eric Douglas:
>> I'll look into that JIRA, thanks.
>> The pdfbox error in the original message below shows the class and method producing this message in the Java log.
>>
>> Digging a little deeper, this is caused by the pdfbox method:
>> org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary.getFontFile2()
>>
>> This is trying to read the "FontFile2" key which was written by FOP.
>> org.apache.fop.pdf.PDFFontDescriptor.setFontFile()
>>
>> One of these is missing something.
> Ah, this confirmed my suspicion. That issue seemd to be related to PDFBOX-490.
>
>> -----Original Message-----
>> From: Andreas Lehmkuehler [mailto:andreas@lehmi.de]
>> Sent: Monday, September 12, 2011 3:30 PM
>> To: users@pdfbox.apache.org
>> Cc: fop-users@xmlgraphics.apache.org
>> Subject: Re: How to make embedded font readable?
>>
>> Hi,
>>
>> Am 12.09.2011 15:31, schrieb Eric Douglas:
>>> FOP created the PDF.  Pdfbox is trying to read it.
>>> I'm not sure which end is missing what.
>>> I'm embedding fonts and pdfbox says there's something there it can't
>>> read.
>> I guess it is an issue with PDFBox, but without a sample PDF it's only a guess.
>> Please create an issue on JIRA [1] and attach a sample pdf to it.
>>
>>> Sep 12, 2011 9:18:12 AM
>>> org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
>>> INFO: Can't read the embedded font EAAAAD+LucidaSans-Typewriter
>>
>>
>> BR
>> Andreas Lehmkühler
>>
>> [1] https://issues.apache.org/jira/browse/PDFBOX
>
> BR,
> Andreas Lehmkühler
>
> [1] https://issues.apche.org/jira/browse/PDFBOX-490


Re: How to make embedded font readable?

Posted by Martin Haberstroh <ma...@yahoo.com>.
Can someone tell me how to unsubscribe from this email distribution?  I have tried the unsubscribe process several times on the site but it does not work.
Thanks.



________________________________
From: Andreas Lehmkuehler <an...@lehmi.de>
To: users@pdfbox.apache.org
Sent: Monday, September 12, 2011 11:15 PM
Subject: Re: How to make embedded font readable?

Hi,

Am 12.09.2011 21:54, schrieb Eric Douglas:
> I'll look into that JIRA, thanks.
> The pdfbox error in the original message below shows the class and method producing this message in the Java log.
>
> Digging a little deeper, this is caused by the pdfbox method:
> org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary.getFontFile2()
>
> This is trying to read the "FontFile2" key which was written by FOP.
> org.apache.fop.pdf.PDFFontDescriptor.setFontFile()
>
> One of these is missing something.
Ah, this confirmed my suspicion. That issue seemd to be related to PDFBOX-490.

> -----Original Message-----
> From: Andreas Lehmkuehler [mailto:andreas@lehmi.de]
> Sent: Monday, September 12, 2011 3:30 PM
> To: users@pdfbox.apache.org
> Cc: fop-users@xmlgraphics.apache.org
> Subject: Re: How to make embedded font readable?
>
> Hi,
>
> Am 12.09.2011 15:31, schrieb Eric Douglas:
>> FOP created the PDF.  Pdfbox is trying to read it.
>> I'm not sure which end is missing what.
>> I'm embedding fonts and pdfbox says there's something there it can't
>> read.
> I guess it is an issue with PDFBox, but without a sample PDF it's only a guess.
> Please create an issue on JIRA [1] and attach a sample pdf to it.
>
>> Sep 12, 2011 9:18:12 AM
>> org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
>> INFO: Can't read the embedded font EAAAAD+LucidaSans-Typewriter
>
>
> BR
> Andreas Lehmkühler
>
> [1] https://issues.apache.org/jira/browse/PDFBOX

BR,
Andreas Lehmkühler

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

RE: How to make embedded font readable?

Posted by Eric Douglas <ed...@blockhouse.com>.
It appears to be finding the correct font, wherever that (org.apache.pdfbox.pdmodel.font.FontManager) gets it from.
If I can get it to compile I could just hack around this problem and remove the code creating the log messages.

Sep 13, 2011 11:20:54 AM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
INFO: Can't read the embedded font EAAAAD+LucidaSans-Typewriter
Sep 13, 2011 11:20:54 AM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
INFO: Using font Lucida Sans Typewriter Regular instead
Sep 13, 2011 11:20:54 AM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
INFO: Can't read the embedded font EAAAAE+LucidaSans-TypewriterBold
Sep 13, 2011 11:20:54 AM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
INFO: Using font Lucida Sans Typewriter Bold instead

The problem is the log messages are caused by pdfbox finding a font object on the text object and trying to use that to create a java.awt.Font but it's not a font.
To reduce the size of the PDF, that font object only contains the glyphs used in the text object rather than the entire font file.
I don't know if there's an easy way to replace that statement with one that reads it in as what it is, a set of glyphs.
                awtFont = Font.createFont( Font.TRUETYPE_FONT, ff2Stream.createInputStream() );
Wherever this gets it's values, it is working.
                awtFont = FontManager.getAwtFont(fd.getFontName());

Now to figure out what the next warning is doing.
Sep 13, 2011 11:20:54 AM org.apache.pdfbox.pdmodel.font.PDSimpleFont drawString
WARNING: Changing font on < > from <Lucida Sans Typewriter Bold> to the default font


-----Original Message-----
From: Andreas Lehmkuehler [mailto:andreas@lehmi.de] 
Sent: Tuesday, September 13, 2011 2:16 AM
To: users@pdfbox.apache.org
Subject: Re: How to make embedded font readable?

Hi,

Am 12.09.2011 21:54, schrieb Eric Douglas:
> I'll look into that JIRA, thanks.
> The pdfbox error in the original message below shows the class and method producing this message in the Java log.
>
> Digging a little deeper, this is caused by the pdfbox method:
> org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary.getFontFile2
> ()
>
> This is trying to read the "FontFile2" key which was written by FOP.
> org.apache.fop.pdf.PDFFontDescriptor.setFontFile()
>
> One of these is missing something.
Ah, this confirmed my suspicion. That issue seemd to be related to PDFBOX-490.

> -----Original Message-----
> From: Andreas Lehmkuehler [mailto:andreas@lehmi.de]
> Sent: Monday, September 12, 2011 3:30 PM
> To: users@pdfbox.apache.org
> Cc: fop-users@xmlgraphics.apache.org
> Subject: Re: How to make embedded font readable?
>
> Hi,
>
> Am 12.09.2011 15:31, schrieb Eric Douglas:
>> FOP created the PDF.  Pdfbox is trying to read it.
>> I'm not sure which end is missing what.
>> I'm embedding fonts and pdfbox says there's something there it can't 
>> read.
> I guess it is an issue with PDFBox, but without a sample PDF it's only a guess.
> Please create an issue on JIRA [1] and attach a sample pdf to it.
>
>> Sep 12, 2011 9:18:12 AM
>> org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
>> INFO: Can't read the embedded font EAAAAD+LucidaSans-Typewriter
>
>
> BR
> Andreas Lehmkühler
>
> [1] https://issues.apache.org/jira/browse/PDFBOX

BR,
Andreas Lehmkühler

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

Re: How to make embedded font readable?

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

Am 12.09.2011 21:54, schrieb Eric Douglas:
> I'll look into that JIRA, thanks.
> The pdfbox error in the original message below shows the class and method producing this message in the Java log.
>
> Digging a little deeper, this is caused by the pdfbox method:
> org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary.getFontFile2()
>
> This is trying to read the "FontFile2" key which was written by FOP.
> org.apache.fop.pdf.PDFFontDescriptor.setFontFile()
>
> One of these is missing something.
Ah, this confirmed my suspicion. That issue seemd to be related to PDFBOX-490.

> -----Original Message-----
> From: Andreas Lehmkuehler [mailto:andreas@lehmi.de]
> Sent: Monday, September 12, 2011 3:30 PM
> To: users@pdfbox.apache.org
> Cc: fop-users@xmlgraphics.apache.org
> Subject: Re: How to make embedded font readable?
>
> Hi,
>
> Am 12.09.2011 15:31, schrieb Eric Douglas:
>> FOP created the PDF.  Pdfbox is trying to read it.
>> I'm not sure which end is missing what.
>> I'm embedding fonts and pdfbox says there's something there it can't
>> read.
> I guess it is an issue with PDFBox, but without a sample PDF it's only a guess.
> Please create an issue on JIRA [1] and attach a sample pdf to it.
>
>> Sep 12, 2011 9:18:12 AM
>> org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font getawtFont
>> INFO: Can't read the embedded font EAAAAD+LucidaSans-Typewriter
>
>
> BR
> Andreas Lehmkühler
>
> [1] https://issues.apache.org/jira/browse/PDFBOX

BR,
Andreas Lehmkühler

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