Get started
PDF color spaces: RGB vs CMYK for screen and print

PDF color spaces: RGB vs CMYK for screen and print

HTML to PDF renders in RGB, but offset print shops want CMYK. Learn the difference, when each matters, and how to convert a PDF to CMYK with Ghostscript.

9 min read

HTML to PDF always renders in RGB, so a PDF you generate from a web template is correct for screen, email, and digital download out of the box. It needs converting to CMYK only when it goes to an offset or commercial press. RGB describes color as light (red, green, blue) for monitors; CMYK describes color as ink (cyan, magenta, yellow, key/black) for paper.

This guide explains the difference, shows when each color space matters, and walks through converting an RGB PDF to a print-ready CMYK file with Ghostscript. It assumes you generate PDFs from HTML with a headless browser or with PDF4.dev.

What is the difference between RGB and CMYK in a PDF?

RGB and CMYK are two color models that describe how a PDF stores color. RGB is additive: it mixes red, green, and blue light, and equal full amounts make white, which is how a screen works. CMYK is subtractive: it mixes cyan, magenta, yellow, and black ink on white paper, and more ink means darker, which is how a press works.

The practical consequence is gamut, the range of colors each model can express. The sRGB gamut used on the web is wider than a typical CMYK ink gamut, so some bright screen colors have no exact ink equivalent. That is why a neon green that glows on a monitor prints as a muted olive.

PropertyRGBCMYK
ModelAdditive (light)Subtractive (ink)
ChannelsRed, Green, BlueCyan, Magenta, Yellow, Key (black)
Color range (gamut)WiderNarrower
Native mediumScreens, web, digital PDFOffset and commercial print
Default in HTML to PDFYesNo, needs conversion
Typical ICC profilesRGB IEC61966-2.1FOGRA39, GRACoL 2006

The sRGB color space is the default for the web and the assumed input when a browser renders a page. The black in CMYK is labeled K for key, the plate that carries detail and outlines, kept separate from the B in RGB to avoid confusion.

Does HTML to PDF produce RGB or CMYK?

HTML to PDF produces RGB, every time. Headless Chromium, the engine behind Playwright and Puppeteer, renders in sRGB and writes RGB color into the PDF. There is no flag that makes page.pdf() emit CMYK, because the browser has no print color management pipeline. The same is true of any HTML-to-PDF service built on Chromium, including PDF4.dev.

This is the right default for most PDFs. Invoices, reports, tickets, contracts, and anything emailed or downloaded are read on screen, where RGB is exactly what the display wants. You only hit the limit when the file is destined for an offset press that separates art into ink plates.

If you generate documents that stay digital, you never need to think about CMYK. Render the HTML, deliver the RGB PDF, and the colors on the reader's screen match what you designed. Try it with the free HTML to PDFTry it free tool or the complete HTML to PDF guide.

When do you need a CMYK PDF?

You need a CMYK PDF when the file goes to offset or commercial printing, where the press lays down four ink plates and expects the art pre-separated into those channels. Brochures, packaging, business cards, magazines, and large print runs fall into this group. A short answer: if a print shop quotes you a job, ask for their color requirement first.

You do not need CMYK for office laser printers, home inkjets, or print-on-demand digital presses. Those devices accept RGB and convert internally with their own profiles, and forcing CMYK early can make the result worse. The decision is about the printing method, not whether the document will ever touch paper.

Use caseColor spaceRecommended format
Email, web download, digital archiveRGB (sRGB)PDF or PDF/A
Office laser or inkjet printerRGBPDF
Print-on-demand, short-run digitalRGBPDF
Offset and commercial pressCMYKPDF/X-1a or PDF/X-4
Color-managed proofingTagged RGBPDF/X-4

When in doubt, keep RGB and let the printer convert. A professional shop has calibrated profiles for its exact press and paper, which usually beats a generic conversion you run blind.

How do you convert a PDF from RGB to CMYK?

Convert an RGB PDF to CMYK with Ghostscript, a free open-source tool, using the pdfwrite device and the CMYK color conversion strategy. The minimal command remaps every color to the DeviceCMYK model:

gs -dSAFER -dBATCH -dNOPAUSE \
  -sDEVICE=pdfwrite \
  -dProcessColorModel=/DeviceCMYK \
  -sColorConversionStrategy=CMYK \
  -o output-cmyk.pdf \
  input-rgb.pdf

That works, but a plain conversion uses Ghostscript's default profiles, which may not match your press. For accurate color, pass an input sRGB profile and an output CMYK profile such as FOGRA39:

gs -dSAFER -dBATCH -dNOPAUSE \
  -sDEVICE=pdfwrite \
  -dProcessColorModel=/DeviceCMYK \
  -sColorConversionStrategy=CMYK \
  -sSourceObjectICC=srgb.icc \
  -sOutputICCProfile=CoatedFOGRA39.icc \
  -o output-cmyk.pdf \
  input-rgb.pdf

You can wire this into a backend so the API renders RGB and a worker converts to CMYK on demand:

import { execFile } from "node:child_process";
import { promisify } from "node:util";
 
const run = promisify(execFile);
 
async function toCmyk(inputPath, outputPath) {
  await run("gs", [
    "-dSAFER", "-dBATCH", "-dNOPAUSE",
    "-sDEVICE=pdfwrite",
    "-dProcessColorModel=/DeviceCMYK",
    "-sColorConversionStrategy=CMYK",
    "-sOutputICCProfile=CoatedFOGRA39.icc",
    `-o${outputPath}`,
    inputPath,
  ]);
}

Ghostscript ships color profiles, and printer associations publish standard ICC profiles you can download. Always confirm the profile name with your print shop, because it defines how RGB maps onto ink.

Why do colors look duller after converting to CMYK?

Colors look duller after CMYK conversion because the ink gamut cannot reproduce the most saturated screen colors, so the converter clips them to the nearest printable value. A pure RGB green of #00FF00 or a vivid cyan simply has no ink mix that matches, and the result reads as a softer, grayer version.

This is physics, not a bug. Light on a monitor can be more intense than reflected light off paper. The fix is to design within the CMYK gamut when you know a job will print: avoid relying on neon accents, check saturated colors in a soft proof, and pick brand colors that survive the conversion.

A soft proof helps you see the shift before printing. Acrobat Pro and preflight tools simulate the CMYK output on screen using the press ICC profile. It is an approximation, since the monitor still emits RGB, but it catches the colors that will fade so you can adjust them in the source HTML or CSS first. See the CSS print styles guide for controlling print output in the browser.

What is PDF/X and how does it relate to CMYK?

PDF/X is a family of ISO standards (ISO 15930) for print-ready PDFs that constrain color, transparency, and fonts so a file prints predictably. It is the format most offset shops ask for, and the variant determines whether RGB is allowed at all or whether everything must already be CMYK.

The differences matter when a printer rejects your file. PDF/X-1a is the strictest: CMYK and spot colors only, no RGB, transparency flattened. PDF/X-4 is the modern choice: it permits color-managed RGB with an output intent and keeps live transparency, so a Chromium-rendered PDF with an embedded profile can qualify without a full CMYK conversion.

StandardColor allowedTransparencyBest for
PDF/X-1a:2001CMYK and spot onlyFlattenedStrict offset workflows, no RGB
PDF/X-3:2002CMYK, spot, ICC-tagged RGBFlattenedColor-managed presses
PDF/X-4:2010CMYK, spot, ICC-tagged RGBLiveModern print, transparency preserved

Every PDF/X file carries an output intent, an embedded ICC profile that names the target press condition. That is the piece that makes the colors reproducible. For long-term digital archiving rather than print, the related PDF/A standard plays the same role; see the PDF/A compliance guide.

How do you keep blacks crisp in a print PDF?

Keep blacks crisp by using plain K100 for small text and thin lines, and a rich black mix only for large solid areas. Plain black uses a single ink plate, so it cannot misregister and blur the edges of type. A rich black such as C60 M40 Y40 K100 adds the other inks for depth, which large fills need but small text does not.

Never use registration black, where all four channels sit at 100 percent, for body content. Registration black is meant for crop marks that must appear on every plate. As page content it lays down too much ink, which can smear, take longer to dry, and crack on folds.

When you generate the HTML, set body text to a pure black and reserve rich black for headers or full-bleed backgrounds. After conversion, check the black mix in a preflight tool so a stray rich black has not crept into your paragraphs. To strip color entirely for a grayscale proof, the PDF to grayscaleTry it free tool converts a finished PDF in the browser.

RGB or CMYK: which should you generate?

Generate RGB and convert to CMYK only at the end, only when an offset press requires it. RGB is the native output of any HTML-to-PDF pipeline and the correct space for the screen-first documents most applications produce. Treat CMYK as a print-shop export step, driven by the printer's stated profile, not as a default.

PDF4.dev renders your HTML templates to RGB PDFs through the same Chromium engine described here, which is what you want for invoices, reports, certificates, and anything delivered digitally. When a file needs to hit an offset press, run the Ghostscript conversion above with your printer's ICC profile, embed the output intent, and verify the result in preflight. For the broader rendering pipeline, see PDF generation best practices.

Start generating screen-ready PDFs from HTML with the PDF4.dev API, and reach for CMYK conversion only on the jobs that truly print on a press.

Free tools mentioned:

Html To PdfTry it freePdf To GrayscaleTry it free

Start generating PDFs

Build PDF templates with a visual editor. Render them via API from any language in ~300ms.