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) —
summaryonly: 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 inlineoperatorused, the namedresource_id, and the exactpdf_object_idto pinpoint rogue color spaces.
Color space families reported (in the "family" field):
PDF color space |
Reported family |
|---|---|
/DeviceGray |
|
/DeviceRGB, /CalRGB |
|
/DeviceCMYK, /CalGray (4-component) |
|
/Lab |
|
/ICCBased |
|
/Separation, /DeviceN |
|
/Indexed |
resolved to base |
/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