Gold foil, a Pantone match, spot varnish, white ink and a sticker's cut line each need their own plate, so the PDF must carry them as named spot inks, printed on top of the artwork rather than knocking it out. A browser editor can produce that file directly: the customer designs with ordinary colors, and the export maps each reserved color to the ink your press or cutter expects.
This post shows how that works in Polotno, our design editor SDK, with @polotno/pdf-export in the browser or in Node.js. The same idea applies to any pipeline that writes PDF.
Why finishes need spot inks
A four-color press builds every color from cyan, magenta, yellow and black. Foil, metallic and fluorescent inks, varnish and white ink do not come from those four: each is a separate plate, a separate pass or a separate machine. A cutter follows the paths drawn in one named spot color and ignores the rest of the file.
So a print file that carries a finish needs three things:
- The finish on its own separation, named the way the press or RIP expects:
Gold_Foil,PANTONE_871_C,Varnish,White,CutContour. - Overprint on that ink, so the press lays it on top of the CMYK artwork instead of punching a hole in it. Without overprint, a slight misregistration leaves a white halo around the foil.
- A CMYK fallback, so proofs and screen previews still show something sensible.
Designing with reserved colors
Customers do not need to know any of this. The pattern is to reserve one color per finish: the template uses exactly that color wherever the finish goes, and nothing else in the design does. Gold text in the template is one exact gold, such as #FFD700, and the cut line is one exact magenta. In the editor they look like plain colors. The business card print editor works this way: the gold on the card is a foil, shown as gold on screen.
Lock the finish elements with element locking, and limit the palette with your own color picker, so a customer cannot give their own text or shapes the reserved foil color by accident.
Mapping colors to inks at export
At export, each reserved color maps to a named ink with its fallback and overprint:
import { jsonToPDF } from '@polotno/pdf-export';
import { readFile } from 'node:fs/promises';
const profile = new Uint8Array(await readFile('./CoatedFOGRA39.icc'));
await jsonToPDF(design, './order-1042.pdf', {
pdfx: 'x-4',
outputIntent: { profile, identifier: 'FOGRA39' },
includeBleed: true,
cropMarkSize: 18,
spotColors: {
'#FFD700': { name: 'Gold Foil', cmyk: [0, 0.15, 0.5, 0], overprint: true },
'#FF00FF': { name: 'CutContour', cmyk: [0, 1, 0, 0], overprint: true },
},
});Color matching is forgiving: '#ffd700', 'rgb(255,215,0)' and 'rgba(255,215,0,1)' all match the same entry, on text, lines, figures and SVG artwork. A color stored as CMYK never matches, so reserve finish colors as hex or RGB. Ink names keep letters, digits, - and _, so Gold Foil is written as Gold_Foil, and a printer who expects PANTONE 871 C gets PANTONE_871_C. Confirm the exact name with your printer. The full option list is on the PDF export page.
Cut lines for stickers and labels
A cut line is a stroked path in the reserved cut color, a set distance outside the artwork, mapped to CutContour (or KissCut, or whatever your RIP reads). It prints nothing; the cutter follows it.
Drawing it by hand per sticker does not scale, so the sticker cut-line editor traces it: the page renders without the line on a small grid, the artwork grows by the offset, and the outline of each piece becomes a closed, simplified SVG path. It reruns a moment after every edit and sits in the design as a locked element. The demo's code is yours to adapt. The sticker and label editor SDK page covers the product side.
White ink
Clear vinyl, kraft labels and dark garments need a white layer under the color. White is a spot ink too: draw the white shape in its own reserved color, keep it above the artwork in the layer order, and map that color to your printer's White ink with overprint. In your RIP, pick the mode that prints the white plate first, under the color.
A white shape placed below the artwork loses its plate wherever the artwork covers it, because the artwork knocks it out. On the canvas the white shape on top hides the artwork, so add it in your production step after the customer finishes.
Things that break a finish, and how the export handles them
Transparency in PDF/X-1a. PDF/X-1a cannot keep transparency, so the export flattens transparent pages to CMYK images. Flattening would destroy a spot ink, so an X-1a page that combines transparency with a spot color is refused instead. Use PDF/X-4, which keeps both.
Effects that rasterize. Blurred text and SVGs with filters are drawn as process-color images, so they cannot carry an ink. If one of them uses a mapped spot color, the export fails with EXPORT_FAILED and names the page, the element and the ink, rather than quietly printing the foil as yellow.
Fills on a cut path. Every element in the cut color becomes part of the cut path, so draw the cut line as a stroke with no fill and keep that color off all artwork.
Gradients and placed images. A reserved color inside a gradient, or in an SVG file placed as an image rather than an SVG element, prints in process color with no error. Keep finishes in solid fills and strokes on vector elements.
Checking the file
Open the PDF in Acrobat Pro: Print Production → Output Preview → Separations lists every ink, and turning one off shows exactly what sits on that plate. Turn on Simulate Overprinting to see how foil and varnish will composite. For PDF/X itself, our post on generating a print-ready PDF in JavaScript covers how to test the file when no free tool validates PDF/X.
Run checks on the live design to catch a missing bleed, a low-resolution photo or text outside the safe area while the customer is still in the editor. The print preflight demo runs fifteen of them. Checks for the reserved colors and the cut-line distance are yours to add.
FAQ
Can a customer pick a Pantone color in the editor?
Give the template a palette of reserved colors and map each to its Pantone ink at export. The customer picks a swatch; the press gets the named ink.
Does foil show in the editor?
It shows as the reserved color, such as gold. Acrobat's Output Preview shows the foil plate in the exported PDF.
Do I need PDF/X for spot inks?
No, a regular vector PDF carries them too. Many printers ask for PDF/X-4, which keeps spot inks and transparency together.
Can I export cut lines from the server?
Yes. The same options work with @polotno/pdf-export in Node.js. The Cloud Render API takes the same spotColors and cropMarkSize in a render job and writes vector PDF or PDF/X with CMYK through its built-in FOGRA39 or US Web Coated (SWOP) profile. For your printer's own ICC profile, run @polotno/pdf-export yourself.
