Skip to content
JamFrame
Docs menu

Print-ready and smaller PDFs

Experimental: use response.cmyk to turn a PDF render into a CMYK PDF/X-4 file for print, and response.compress to make a PDF smaller.

Two options in response change a PDF after it is made:

  • cmyk makes a print-ready PDF. Printers use CMYK inks, and print shops often ask for a CMYK file.
  • compress makes a PDF smaller, for email and downloads.

Both work only with "format": "pdf", and both are free: a PDF costs one credit per page, as always.

Make a print-ready PDF

Add cmyk to response. true uses the most common printing condition, fogra39:

curl https://api.jamframe.com/v1/render \
  -H "Authorization: Bearer $JAMFRAME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "clx8m2k3p0003abcd1234efgh",
    "modifications": { "customer_name": "Jane Doe" },
    "response": { "format": "pdf", "cmyk": true }
  }'
const res = await fetch("https://api.jamframe.com/v1/render", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.JAMFRAME_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    templateId: "clx8m2k3p0003abcd1234efgh",
    modifications: { customer_name: "Jane Doe" },
    response: { format: "pdf", cmyk: true },
  }),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error}: ${body.message}`);
console.log(body.data.content); // the link to the print-ready PDF
import os
import requests

res = requests.post(
    "https://api.jamframe.com/v1/render",
    headers={"Authorization": f"Bearer {os.environ['JAMFRAME_API_KEY']}"},
    json={
        "templateId": "clx8m2k3p0003abcd1234efgh",
        "modifications": {"customer_name": "Jane Doe"},
        "response": {"format": "pdf", "cmyk": True},
    },
)
res.raise_for_status()
print(res.json()["data"]["content"])  # the link to the print-ready PDF

The answer looks like any PDF render. data.content is the link to the CMYK file.

What changes in the file:

  • The colors are converted for the paper and press you choose, using that printing condition’s color profile. The profile is saved in the PDF, so the printer knows what the numbers mean.
  • Text and shapes stay sharp: they are not turned into pictures.
  • Black and grey text, and thin lines, print with black ink only. They stay crisp even if the press’s inks don’t line up perfectly.
  • The PDF gets the PDF/X-4 label, the print standard many print shops ask for, when it qualifies.

Choose the printing condition

Send the profile you need, such as { "cmyk": { "profile": "gracol2013" } }:

profile Use it for
fogra39 (default) Offset printing on coated paper, Europe. The most common choice.
fogra51 Offset on coated paper, Europe, the newer standard (PSO Coated v3).
fogra52 Offset on uncoated paper, Europe, the newer standard (PSO Uncoated v3).
fogra47, fogra29 Offset on uncoated paper, Europe.
fogra40, fogra45 Magazines (SC and LWC paper).
ifra26 Newspapers.
gracol2013 Sheet-fed offset on coated paper, USA.
gracol2013-uncoated Offset on uncoated paper, USA.
swop2013 Magazines printed on web presses, USA.
gracol2006 The older GRACoL standard, USA.
japan2011 Japan Color 2011, coated paper.

Not sure which one? Ask your print shop which printing condition or ICC profile they want.

How it looks on screen

A CMYK PDF can look a little different from the normal one:

  • Some bright screen colors, like a vivid blue or neon green, can’t be printed. They come out a little duller.
  • See-through layers (opacity, blend modes) mix a little differently in CMYK.
  • The file is about 100 KB larger, because it carries the color profile. Add compress to make it smaller again.

Make a PDF smaller

Add compress to response. true uses the ebook preset:

{
  "templateId": "clx8m2k3p0003abcd1234efgh",
  "modifications": { "customer_name": "Jane Doe" },
  "response": { "format": "pdf", "compress": true }
}

What changes in the file:

  • Pictures that have more detail than the page needs are made smaller. JamFrame measures each picture at the size it is drawn on the page, and only makes it smaller when it has more than 1.5 times the resolution you ask for.
  • Photos may be stored as JPEG. Drawings, logos and emoji stay sharp.
  • The file is packed more tightly.
  • Text and shapes don’t change.

Pick a preset, such as { "compress": { "preset": "printer" } }:

preset Pictures at Use it for
screen 72 dpi The smallest files, to view on a screen.
ebook (default) 150 dpi Email and downloads.
printer 300 dpi Office printers.
prepress 300 dpi, best quality Print shops.

To set the picture resolution yourself, add dpi, from 36 to 1200: { "compress": { "preset": "printer", "dpi": 200 } }.

Both together

With cmyk and compress in one request, the CMYK PDF is the one that’s compressed. This request makes a PDF for a US print shop and keeps pictures at print quality:

{
  "templateId": "clx8m2k3p0003abcd1234efgh",
  "modifications": { "customer_name": "Jane Doe" },
  "response": {
    "format": "pdf",
    "cmyk": { "profile": "gracol2013" },
    "compress": { "preset": "printer" }
  }
}

For print, use printer or prepress. screen and ebook make pictures too small for paper.

Check the result

  • Ask your print shop to check a first file. Most check PDFs when you upload them.
  • In Adobe Acrobat Pro, Print Production → Output Preview shows the inks a PDF uses, and Preflight checks it against PDF/X-4.

Limits and credits

  • Only with "format": "pdf". Sent with another format, cmyk or compress is a 400. false is the same as leaving them out.
  • They work with includePages, size, sizes and async. Signed URLs, dynamic URLs and forms don’t take them yet.
  • They cost nothing extra: one credit per PDF page.
  • The conversion counts toward the render’s time limit. If it fails, the render fails with 500 and costs nothing.

Last updated

Still stuck?

Email [email protected] and a real person will reply. Tell us the template you were using and what you expected to happen.