Skip to main content
Version: 9.x

Convert the colors

Converts every color of a PDF to one color space.

POST/forms/pdf/convert-colors
filesfile[]required

The PDFs.

archivesfile[]

ZIP files Gotenberg unpacks: each entry counts as a file uploaded under files.

URLs Gotenberg downloads first, as if you had uploaded the files. Each entry takes a url, and optionally extraHttpHeaders.

targetstringrequired

cmyk, rgb, gray, or output-intent for the document's own output intent.

The PDF, or a ZIP of the PDFs when you send several.

The route also takes the headers. An error answers a status and a message: see Errors.

curl \
--request POST http://localhost:3000/forms/pdf/convert-colors \
--form files=@report.pdf \
--form target=gray \
-o report.pdf

target takes cmyk for a print shop, gray for black and white printing, rgb for screens, or output-intent for the one the PDF declares.

In a list of stages​

The stage also runs in a list on /forms/pdf/pipe, and on the PDFs a Chromium or LibreOffice conversion makes, in its stages field:

curl \
--request POST http://localhost:3000/forms/pdf/pipe \
--form files=@report.pdf \
--form 'stages=[
{ "op": "convert-colors", "target": "gray" }
]' \
-o report.pdf