dump_colorspaces

Report color spaces used

Usage

pdftl <input> dump_colorspaces [pages] [full] [<page_spec>...] [output <output>]

Details

The dump_colorspaces operation inspects all color spaces used in a PDF document — across raster images, vector paths, and text — and reports them as structured JSON.

It walks every page’s content stream (recursing into Form XObjects), tracks the graphics state stack, and collects every color-setting operator. ICC profiles are reported with both their tag and resolved family. Separation and DeviceN spot colors are reported with their colorant names and alternate color space.

Output levels (controlled by optional keywords):

  • (default)summary only: the set of all color space families seen across the whole document, plus any ICC profiles encountered.

  • pages — adds a per-page summary (families seen on each page).

  • full — adds per-page element-level detail: images, strokes, fills, patterns, and shadings broken out individually. This level includes rich traceability, reporting the inline operator used, the named resource_id, and the exact pdf_object_id to pinpoint rogue color spaces.

Color space families reported (in the "family" field):

PDF color space

Reported family

/DeviceGray

gray

/DeviceRGB, /CalRGB

rgb

/DeviceCMYK, /CalGray (4-component)

cmyk

/Lab

lab

/ICCBased

icc (+ family from profile)

/Separation, /DeviceN

spot

/Indexed

resolved to base

/Pattern

pattern

Examples

Report color spaces used in in.pdf (summary only)

pdftl in.pdf dump_colorspaces

Report color spaces per page

pdftl in.pdf dump_colorspaces pages

Full element-level color space report saved to cs.json

pdftl in.pdf dump_colorspaces full output cs.json

Report color spaces for pages 1, 3, 4, and 5 (summary)

pdftl in.pdf dump_colorspaces 1 3-5

Tags: info, metadata, color, prepress

Source: pdftl.operations.dump_colorspaces

Read online: https://pdftl.readthedocs.io/en/latest/operations/dump_colorspaces.html

Type: Operation