[ 
https://issues.apache.org/jira/browse/PDFBOX-3395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15375371#comment-15375371
 ] 

John Hewson edited comment on PDFBOX-3395 at 7/13/16 5:16 PM:
--------------------------------------------------------------

I'm not sure about this fix. Isn't the problem that our parser is treating an 
empty  glyph table as being missing, when in fact it is present, it's just 
empty. This fix seems to be propagating the parsing problem so that other logic 
has to handle a null glyph table, but it seems like the parser should actually 
just be producing an empty (but not null) glyph table?

That would make the exception correct - glyf must be present. Instead the 
parser should tolerate it being empty and not parse it as null.


was (Author: jahewson):
I'm not sure about this fix. Isn't the problem that our parser is treating an 
empty  glyph table as being missing, when in fact it is present, it's just 
empty. This fix seems to be propagating the parsing problem so that other logic 
has to handle a null glyph table, but it seems like the parser should actually 
just be producing an empty (but not null) glyph table?

That would make the exception correct - glyf must be present. But the parser 
should tolerate it being empty and not parse it as null.

> Throwing exception when PDF has unused empty fonts embedded.
> ------------------------------------------------------------
>
>                 Key: PDFBOX-3395
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3395
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>            Reporter: Daniel Persson
>
> I was trying to follow up on the issues in our system and found that some PDF 
> files threw ERRORs. These PDFs are produced by a publishing system and that 
> system seems to add fonts when you change to them and add them even though 
> they are never used. Or only space is used. Then they add this font with an 
> empty glyf table. This results in that errors are thrown on files that are 
> fine.
> Line 310 in TTFParser removes empty glyf tables.
>         // skip tables with zero length
>         if (table.getLength() == 0)
>         {
>             return null;
>         }
>         return table;
> Line 215 of TTFParser throws exception when glyf table is missing.
>             if (font.getGlyph() == null)
>             {
>                 throw new IOException("glyf is mandatory");
>             }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to