3

I have a PDF which renders fine in Acrobat but fails to print during the PDF to PS conversion process on our printer's RIP. After uncompressing with pdftk and editing I've found if I replace the usage of a certain font it will print.

The font is a strange one, a TrueType subset with a single character (space).

If I pass the PDF through Ghostscript it reports no errors, however an Acrobat pre-flight check will report a missing glyph for space. This error is not reported for the original file. I'm just using a basic command: gswin32c -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -o gs.pdf original_sample.pdf

I've pulled out the font data from the original PDF and saved it. Running TTFDUMP.exe produces an interesting result where it seems that the 'glyf' table is missing:

4. 'glyf' - chksm = 0x00000000, off = 0x00000979, len =        0
5. 'head' - chksm = 0xE463EA67, off = 0x00000979, len =       54

Just wondering, am I interpreting this result correctly? Is it valid to run TTFDUMP like this on extracted data from a PDF? I think a 'glyf' table is required based on the spec, at least for the first 4 necessary characters.

TTFDUMP run on the ghostscript PDF produces a similar result but with a 1-byte 'glyf' table.

If so it seems that Acrobat doesn't particularly care about the missing space while other programs (including the printer) do. It's odd it isn't reported as missing though until it runs through Ghostscript.

The PDF is created by Adobe InDesign and the font is copyrighted like most so I can't share it.

Edit - I've accepted Ken's answer as he helped me on the Ghostscript bug tracker. In summary, it seems the font is broken as suspected due to the missing glyf table. Until I hear otherwise I'll have to suppose this is a bug in InDesign, and will continue investigating.

Nick P
  • 759
  • 5
  • 20

1 Answers1

2

Yes you can run ttfdump on an embedded subset font, its still a perfectly valid font.

A missing glyph is not specifically a problem, because the .notdef glyph is used instead, a missing .notdef means a font isn't legal.

I think you are mistaken about the legality of sharing the PDF file (from the point of view of font embedding). Practically every PDF file you see will contain copyright fonts, but these are permitted to be embedded and distributed as part of a PDF (or indeed PostScript) file. TrueType fonts contain flags which control the DRM of the font, and which can deny embedding in in PDF (or other formats). Ghostscript honours these embedding flags in the font as does Acrobat Distiller and other Adobe products.

There were some fonts which inadvertently shipped with DRM which prevented embedding, and there's a list somewhere of these, along with an explicit statement from the font foundry that its permissible to embed these fonts. I think this was somewhere on the Adobe web site a few years back.

So if you have a PDF file with the font embedded in it (especially if it was produced by an Adobe application) then I would be comfortable that its legal to share.

I'm having some trouble figuring out what the problem actually is, and how you are using Ghostscript. If you are running the PDF->PS and then back to PDF then all bets are off frankly. Round-tripping files will often provoke problems.

In any event I'm happy to look at the file but you will have to make it available.

KenS
  • 30,202
  • 3
  • 34
  • 51
  • I have added the Ghostscript 9.15 command line, it's just a simple PDF to PDF run done for basic trouble shooting. I did this because most other utilities don't seem to try and interpret font data. I can supply the TTF extract but will need to request permission for the PDF. Let me know if the font extract will be useful and I can upload or email to you, whichever you prefer. – Nick P Oct 16 '14 at 23:39
  • The TTF isn't much help, all I could do would be to confirm what you've already done. I'm still not really clear on exactly what you are doing because you discuss PDF->PS conversion, but actually seem to do PDF in and PDF out. Probably the best way forward is for you to open a bug report and attach an example file three. – KenS Oct 17 '14 at 07:11
  • I've managed to reproduce a similar file in InDesign on our side so it has no sensitive client data. I'm not convinced it's a GS bug yet but will raise a report so you can have a look. Thanks! – Nick P Oct 17 '14 at 07:41