Mark Stephens FollowMark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Differences in the PDF differences tables

June 2, 2011 1 min read

A /Differences entry in a PDF font allows you to setup a custom encoding for a Font (rather that using a standard set of values such as WIN or MAC encoding). In theory, it should be very simple – the glyph number followed by one or more glyph names. Here are 2 examples from the PDF reference guide.

This is very confusing because numbers are being used as character names (and the number is the WIN encoding value for the actual character). So you have to be very exact about whether a value is preceded by a slash (/) which shows it is a name rather than a number. There is also a rather odd i255 value. This PDF file looks like it was created with Ghostscript.

In general, the PDF is far more useful if you use the actual defined glyph names (as in the Adobe examples). Have you seen any odd Differences values?

This post is part of our “Understanding the PDF File Format” series. In each article, we discuss a PDF feature, bug, gotcha or tip. If you wish to learn more about PDF, we have 13 years worth of PDF knowledge and tips, so click here to visit our series index!