Analyzing PDF Colors: Part 1

Analyzing PDF Colors: Part 1

This is the first of a two part series on color analysis and the color conversion features of the Adobe PDF Library. The second post will focus on the Adobe PDF Library color convert APIs and how they compare to Acrobat’s features.

Before taking a look at the color convert APIs, let’s step back a bit. When discussing colors within a PDF, it’s important to make sure that we use reliable analysis and preview tools. After all, I may not always be viewing the PDF document on the same computer as the other person. And, as we know, color is in the eye of the beholder — Wikipedia: The_dress. To that end, I typically use a combination of Acrobat preflight tools.

List Page Objects profile

The first Acrobat option that I use is the List Page Objects profile to get an overall picture of the objects:

Below, we can see a summary of the text objects in our test document, that the text is all CMYK based, and that it is assigned the Reader 9 CMYK profile.

Output Preview -> Object Inspector

I also make use of the Acrobat Output Preview -> Object Inspector tool, which allows you to simply click on objects to get information. Here, the “BLACK” text is shown to use 100% of the K channel, and none of the CMY components.

Browse Internal PDF Structure

To examine the internal commands inside the PDF content stream, I use the Browse Internal PDF Structure preflight tool. Below, we can see that the “YELLOW” text displayed by the Tj (show text) operator is preceded by an scn (set color) operator. The scn operator is passed four arguments in this example, indicating that the text uses CMYK and that the “YELLOW” text is comprised of 79.9% yellow and a minor amount of the Cyan component as well. The Browse Internal Structure option is a powerful Acrobat debugging tool, but requires knowledge of the PDF language syntax.

Of course, there are many other tools outside of the Acrobat product family that can be useful when examining PDF color. If you have any favorites, leave a comment and let me know how your favorite tool helps.

In our next entry, we will examine how the Adobe PDF Library color conversion API compares to the Acrobat color conversion features, and take a look at some of the available sample code.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *