In short
A photography magazine with a velvety coating on every page and a shiny coating only on the photographs and the title. The coatings have no colour, so the page looks normal on screen; the 3D view and a proof view show where they are.
What you'll build
Issue 14 of Long Light, an invented photography magazine: six pages at 210 × 280 mm, perfect bound. Every page is coated in a soft-touch varnish, the velvet finish that dulls the sheet and takes the shine off it. Over the five photographs and the masthead a printer lays a second varnish, a gloss, so the pictures catch the light while the page around them stays still. Neither varnish has a colour: the canvas shows the pages as they print, and three views of the cover beside Folio show the plates and the sheen. Folio lays the magazine open on a marble table in studio light, where the gloss shines as a leaf turns.
This recipe answers
- How do I put a soft-touch varnish on every page and a spot gloss over the photographs only?
The short answer
// A varnish is a spot ink: its own plate in the PDF, clear on screen. Soft touch goes over
// the whole sheet, the gloss over the pictures and the masthead. Both overprint by default,
// so neither cuts a hole in the colours under it. Each has a hex of its own all the same:
// a print render tells inks apart by their hex.
const varnish = (hex, name, sheen) => ({ hex, model: 'spot',
spot: { name, cmyk: { c: 0, m: 0, y: 0, k: 0 }, finish: { kind: 'varnish', sheen } } });
const palette = {
velvet: varnish('#e9e4f0', 'Soft-touch varnish', 'softTouch'),
gloss: varnish('#e4f0ee', 'Spot UV gloss', 'gloss'),
// The colours that print: a near-black, a slate for the bands, the paper.
ink: { hex: '#1d1d22', model: 'cmyk', cmyk: { c: 30, m: 20, y: 10, k: 95 } },
slate: { hex: '#262b3a', model: 'cmyk', cmyk: { c: 80, m: 65, y: 35, k: 60 } },
muted: { hex: '#6c6a70', model: 'cmyk', cmyk: { c: 0, m: 5, y: 0, k: 65 } },
paper: { hex: '#ffffff', model: 'hex' },
};
// The ink table names both varnishes as the order to the printer will.
const PRINT = { standard: 'pdfx4', outputProfile: 'fogra51', convertImages: false, inks: [
{ name: 'Soft-touch varnish', finish: { kind: 'varnish', sheen: 'softTouch' } },
{ name: 'Spot UV gloss', finish: { kind: 'varnish', sheen: 'gloss' } }] };
Two varnishes, each a spot ink with a finish
Ingredients
- Features
- Special inksSpot inks and the ink tableCMYK and grayscale PDFs3D book viewer (Folio)Paper, binding, desk and light (Folio)Semantic colour paletteCovers, title pages and colophonsHeading stylesDesigned openersText, rules and boxes in page designsPictures in page designsRunning heads and foliosPDF exportPages on a canvas
- Also uses
- Heading attributesFull-width chapter bandPaper colourFonts embedded in the PDFCustom resource typesFigures and tables as resourcesRunning heads per sectionUnnumbered chapters
- Type
- Bodoni Moda, Source Serif 4, Source Sans 3 (SIL OFL 1.1)
- Assets
dusk-560.jpgfog-800.jpgnets-1100.jpgroad-1100.jpgsaltflat-800.jpg- A walker on a salt flat at dusk, on the cover (Generated With Diffusion Models, original)
- A fisherman mending a net (Generated With Diffusion Models, original)
- Pines in morning fog (Generated With Diffusion Models, original)
- A desert road between mesas (Generated With Diffusion Models, original)
- The salt flat at sunset, on the back cover (Generated With Diffusion Models, original)
Method
#1 · Each varnish is a spot ink with a finish
The code is the short answer above. A varnish is a spot colour whose finish is varnish, with a sheen: softTouch for the velvet, gloss for the spot UV (finishes). The PDF/X-4 file puts each on a Separation of its own, so the printer gets two varnish plates beside the four process plates. On screen a varnish paints nothing; it still needs a hex of its own, because a print render tells inks apart by their hex. A varnish overprints by default, so neither cuts a hole in the colours under it.
#2 · Soft touch over every page
// The page's footer carries it, so every page has it. A varnish goes down last on press, and
// nothing painted after it cuts it away. The cover and the back keep it alone.
const velvet = { kind: 'box', id: 'velvet', style: { backgroundColor: col('velvet') },
placement: at('bleed', 'top-left', 0, 0, { width: 'fill', height: 'fill' }) };
The soft touch is one box in the varnish, from bleed to bleed. The footer carries it, so every page gets it from one place. A varnish goes down last on press, over everything, and in the PDF nothing the page paints after it cuts it away: the box could as well open the header, before the text and the folios, and they would stay under it on the plate. The cover and the back have no folios, and their footer carries the box alone.
#3 · Gloss over the photographs
// The gloss box comes after the picture, so it lies on top; being a varnish it paints
// nothing on the canvas, and in the PDF it overprints the picture on a plate of its own.
const glossed = (resourceId, placement, focus) => [
{ kind: 'image', id: 'photo', resourceId, fit: 'cover', placement, ...(focus && { focus }) },
{ kind: 'box', id: 'shine', style: { backgroundColor: col('gloss') }, placement },
];
Each photograph is a picture with a box in the gloss laid over it at the same size. The box comes second, so it lies on top: on the plate it is a rectangle that covers the picture exactly, which is how a spot UV plate is drawn.
#4 · The masthead set twice
const BAND = 222; // mm from the top of the bleed to the slate band
const masthead = (id, color) => text(id, '{titleText}', { fontFamily: DISPLAY, fontWeight: 700,
fontSize: pt(84), lineHeight: 0.9, align: 'center', color },
at('page', 'top-left', 0, 12, { width: mm(TRIM_W) }));
const cover = { id: 'cover', numbered: false, toc: false, span: 'page',
footer: { elements: [velvet] }, advancedDesign: { enabled: true, minHeight: mm(230),
slot: { elements: [
...glossed('saltflat', at('bleed', 'top-left', 0, 0, { width: 'fill',
height: mm(BAND + 3) }), { x: 0.5, y: 0.62 }),
{ kind: 'box', id: 'band', style: { backgroundColor: col('slate') },
placement: at('bleed', 'top-left', 0, BAND, { width: 'fill', height: mm(70) }) },
masthead('title', col('paper')), masthead('title-gloss', col('gloss')),
text('issue', '{attr.issue}', { ...label(8, col('paper')), align: 'center' },
at('page', 'top-left', 0, 46, { width: mm(TRIM_W) })),
text('lines', '{attr.lines}', { fontFamily: SERIF, fontSize: pt(12), lineHeight: 1.35,
color: col('paper') }, at('page', 'top-left', MARGIN.outer, BAND + 4,
{ width: mm(150) })),
] } } };
The masthead is two text elements in the same place: one in paper white, which knocks out of the photograph, and one in the gloss over it. The gloss version paints nothing on screen and gives the plate the shapes of the letters, so on the printed cover the title shines over the shining sky.
#5 · The finish views and Folio
// 'flat' paints the inks and leaves the varnish out; 'map' marks the special plates in false
// colour (varnish in cyan) over a faded page; 'sheen' sweeps a light across the page.
const views = document.createElement('section');
views.id = 'finish-views';
views.style.cssText = 'display: flex; gap: 16px; justify-content: center; padding: 16px';
const VIEWS = { flat: t({ en: 'As it prints', es: 'Como se imprime' }),
map: t({ en: 'The varnish plates', es: 'Las planchas de barniz' }),
sheen: t({ en: 'Under a raking light', es: 'Con luz rasante' }) };
for (const [finishes, name] of Object.entries(VIEWS)) {
const [figure, canvas, caption] = ['figure', 'canvas', 'figcaption']
.map((tag) => document.createElement(tag));
figure.style.margin = '0';
canvas.style.width = '260px';
canvas.setAttribute('role', 'img');
canvas.setAttribute('aria-label', `${t({ en: 'The cover', es: 'La cubierta' })}: ${name}`);
renderPageToCanvas(doc.pages[0], doc, canvas, { scale: 520 / doc.pages[0].width, finishes });
caption.textContent = name;
figure.append(canvas, caption);
views.append(figure);
}
document.getElementById('pages').before(views);
const folio = {
tilt: 26, yaw: -18,
paper: { type: 'coatedMatte', grammage: 150 },
binding: { type: 'paperback', cover: 'pages' },
surface: { type: 'marble' },
lighting: { environment: 'studio', intensity: 1.15 },
};
renderPageToCanvas takes a finishes option. 'flat' is the default and shows the page as it prints; 'map' fades the page and marks each special plate in false colour, the varnish in cyan, the gloss brighter than the soft touch; 'sheen' sweeps a light across the page. Folio reads the same finish mask: a gloss catches the highlights, soft touch takes them away.
The whole recipe
// ═══ Postext Cookbook · Nº 192 · Spot gloss over a soft-touch magazine ═════════════════
// https://postext.dev/en/cookbook/spot-uv-photo-magazine
// Code: MIT · Text: original (CC BY 4.0) · Photographs: diffusion models
// Fonts: Bodoni Moda, Source Serif 4, Source Sans 3 (SIL OFL 1.1) · Needs postext ≥ 1.85.1
//
// A photography magazine whose pages are coated in a soft-touch varnish, with a gloss
// varnish laid over the photographs and the masthead only: the spot UV a printer sells as
// the contrast between a velvet page and a shining picture. Varnish puts no colour on the
// page, so the canvas shows the pages as they print and the finish views show the varnish.
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
import { createFolioFromDocument } from 'https://esm.sh/postext-folio';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'spot-uv-photo-magazine';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region answer: two varnishes, each a spot ink with a finish
// A varnish is a spot ink: its own plate in the PDF, clear on screen. Soft touch goes over
// the whole sheet, the gloss over the pictures and the masthead. Both overprint by default,
// so neither cuts a hole in the colours under it. Each has a hex of its own all the same:
// a print render tells inks apart by their hex.
const varnish = (hex, name, sheen) => ({ hex, model: 'spot',
spot: { name, cmyk: { c: 0, m: 0, y: 0, k: 0 }, finish: { kind: 'varnish', sheen } } });
const palette = {
velvet: varnish('#e9e4f0', 'Soft-touch varnish', 'softTouch'),
gloss: varnish('#e4f0ee', 'Spot UV gloss', 'gloss'),
// The colours that print: a near-black, a slate for the bands, the paper.
ink: { hex: '#1d1d22', model: 'cmyk', cmyk: { c: 30, m: 20, y: 10, k: 95 } },
slate: { hex: '#262b3a', model: 'cmyk', cmyk: { c: 80, m: 65, y: 35, k: 60 } },
muted: { hex: '#6c6a70', model: 'cmyk', cmyk: { c: 0, m: 5, y: 0, k: 65 } },
paper: { hex: '#ffffff', model: 'hex' },
};
// The ink table names both varnishes as the order to the printer will.
const PRINT = { standard: 'pdfx4', outputProfile: 'fogra51', convertImages: false, inks: [
{ name: 'Soft-touch varnish', finish: { kind: 'varnish', sheen: 'softTouch' } },
{ name: 'Spot UV gloss', finish: { kind: 'varnish', sheen: 'gloss' } }] };
// #endregion
const col = (id) => ({ ...palette[id], paletteId: id });
const colorPalette = [...Object.entries(palette).map(([id, value]) => ({ id, name: id, value })),
{ id: 'main-color', name: 'ink (defaults)', value: palette.ink }];
const [TRIM_W, TRIM_H] = [210, 280];
const MARGIN = { top: 18, bottom: 20, inner: 18, outer: 16 };
const LEAD = 13.6; // pt
const [DISPLAY, SERIF, SANS] = ['Bodoni Moda', 'Source Serif 4', 'Source Sans 3'];
The composed script.js runs as it is: paste it into any page’s module script, or open the recipe on CodePen. Recipe folder on GitHub ↗ (opens in a new tab)
Variations
#Matte instead of soft touch
A plain matte varnish costs less and shows the same contrast, a little less deep.
- velvet: varnish('#e9e4f0', 'Soft-touch varnish', 'softTouch'),
+ velvet: varnish('#e9e4f0', 'Matte varnish', 'matte'),#Gloss on the type only
Leave the photographs matte and lay the gloss over the masthead and the titles alone: set the titles twice, as the masthead is, and drop the boxes over the pictures.
Pitfalls
- A varnish with the hex of another colour is printed as that colour. Give each varnish a hex nothing else uses.
- An all-over varnish drawn to the trim leaves a bare strip at the edge when the sheet is cut a little off. Take it to the bleed, as the box here does.
- Soft touch is often sold as a laminate rather than a varnish. Ask the printer which plate name they want, and set it with the ink table's
pdfName.
Credits
- Recipe
- Ignacio Ferro
- Text
- Original prose, CC BY 4.0
- Images
- A walker on a salt flat at dusk, on the cover · Generated With Diffusion Models · original
- A fisherman mending a net · Generated With Diffusion Models · original
- Pines in morning fog · Generated With Diffusion Models · original
- A desert road between mesas · Generated With Diffusion Models · original
- The salt flat at sunset, on the back cover · Generated With Diffusion Models · original
- Fonts
- Bodoni Moda (SIL OFL 1.1) · Source Serif 4 (SIL OFL 1.1) · Source Sans 3 (SIL OFL 1.1)
Edit this write-up ↗ (opens in a new tab)Recipe folder on GitHub ↗ (opens in a new tab)


