跳到主要内容
食谱编号192

排版食谱 · 第10章 · 输出与集成

柔感杂志上的局部UV亮光

把两种光油当作专色:每一页都上柔感光油,照片和刊名上再加一层亮光油;在Folio和几种工艺视图里都能看到它们落在哪里,以及印刷厂会收到哪两块印版。

本页内容
输出
Canvas · PDF
难度
高级
Postext
已用Postext 1.86.0测试
需要≥ 1.85.1 · postext-pdf ≥ 1.85.1
许可证
更新于2026年11月13日
代码MIT · 文本CC BY 4.0
  • 英文样例:尚无中文版本
  • 成品尺寸210 × 280 mm
  • 2栏, 栏间距6 mm
  • Source Serif 4 9.8/13.6
  • Bodoni Moda
  • Source Sans 3
  • 6页
  • 难度
  • Postext 1.86.0
  • 排版用时83 ms
  • 213行代码

简单来说

一本摄影杂志,每一页都有一层丝绒般的涂层,只有照片和刊名上有一层发亮的涂层。光油本身没有颜色,所以屏幕上的页面看起来和平常一样;3D视图和一种打样视图会显示涂层在哪里。

成品一览

《Long Light》第14期,一本虚构的摄影杂志:六页,210 × 280 mm,无线胶装。每一页都上一层柔感光油,这种丝绒般的整饰会压暗纸面、去掉反光。在五张照片和刊名上,印刷厂再上第二层光油,一层亮油,让照片接住光线,而周围的页面保持沉静。两种光油都没有颜色:画布显示的就是页面印出来的样子,Folio旁边的三张封面视图则显示印版和光泽。Folio把杂志摊开放在大理石桌上,打着摄影棚的灯光,翻页时亮油会闪一下。

这道食谱解答

  • 怎样给每页上柔感涂层,只在照片上局部上光油?

简短回答

script.js · 第21–39行在完整代码中
// 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' } }] };

用料

类型
Bodoni Moda, Source Serif 4, Source Sans 3(SIL OFL 1.1)
素材
  • dusk-560.jpg
  • fog-800.jpg
  • nets-1100.jpg
  • road-1100.jpg
  • saltflat-800.jpg
  • A walker on a salt flat at dusk, on the cover (Generated With Diffusion Models, 原创)
  • A fisherman mending a net (Generated With Diffusion Models, 原创)
  • Pines in morning fog (Generated With Diffusion Models, 原创)
  • A desert road between mesas (Generated With Diffusion Models, 原创)
  • The salt flat at sunset, on the back cover (Generated With Diffusion Models, 原创)

做法

#1 · 每种光油都是带工艺的专色

代码就是上面的简短回答。光油是一种专色,它的工艺是varnish,再加一种光泽:丝绒感用softTouch,局部UV用gloss(工艺)。PDF/X-4文件把每种光油放进单独的Separation,所以印刷厂会在四块四色印版之外拿到两块光油版。光油在屏幕上什么也不画;但它仍然需要一个自己的hex,因为印刷渲染靠hex来区分油墨。光油默认叠印,所以两种光油都不会把下面的颜色镂空。

#2 · 每一页都上柔感光油

script.js · 第57–60行在完整代码中
// 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' }) };

柔感光油就是光油里的一个框,从出血边铺到出血边。由页脚来承载它,每一页就都从同一个地方得到它。上机时光油最后印,盖在所有东西上面;在PDF里,页面之后画的东西也不会把光油镂空:这个框也可以放在页眉的最前面,先于正文和页码绘制,它们在印版上仍在光油下面。封面和封底没有页码,它们的页脚只承载这个框。

#3 · 照片上的亮光油

script.js · 第64–69行在完整代码中
// 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 },
];

每张照片都是一张图片,上面盖一个同样大小的亮光油框。框排在后面,所以在上层:在印版上它是一个正好盖住照片的矩形,局部UV的印版就是这样画的。

#4 · 刊名排两遍

script.js · 第73–90行在完整代码中
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) })),
    ] } } };

刊名是放在同一位置的两个文字元素:一个用纸白,从照片里镂空出来;另一个用亮光油,压在上面。亮油那一份在屏幕上什么也不画,只把字母的形状交给印版,所以在印好的封面上,刊名在同样发亮的天空上闪着光。

#5 · 工艺视图和Folio

script.js · 第239–259行在完整代码中
// '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);
script.js · 第138–144行在完整代码中
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接受一个finishes选项。'flat'是默认值,显示页面印出来的样子;'map'把页面调淡,用假色标出每一块特殊印版,光油为青色,亮光比柔感更亮;'sheen'让一道光扫过页面。Folio读取同一张工艺遮罩:亮光接住高光,柔感把高光吃掉。

完整食谱

沙盒
// ═══ 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'];

组合好的script.js可以直接运行:把它粘贴到任何页面的模块脚本中,或在CodePen上打开这道食谱。 GitHub上的食谱文件夹 ↗ (在新标签页中打开)

变化

#用哑光油代替柔感

普通的哑光油更便宜,对比效果一样,只是没有那么深。

-  velvet: varnish('#e9e4f0', 'Soft-touch varnish', 'softTouch'),
+  velvet: varnish('#e9e4f0', 'Matte varnish', 'matte'),

#只在文字上亮光

让照片保持哑光,只在刊名和标题上上亮光油:像刊名一样把标题排两遍,再去掉照片上的那些框。

常见问题

  • 光油如果用了另一种颜色的hex,就会被当作那种颜色印出来。给每种光油一个别处都不用的hex。
  • 整页光油如果只铺到成品线,纸张裁切稍有偏差,边上就会留下一条没上光油的白边。要像这里的框一样铺到出血边。
  • 柔感常常是以覆膜而不是光油的形式出售的。问清印刷厂要的印版名称,用油墨表里的pdfName来设置。

致谢

文本
原创文字, CC BY 4.0
图片
  • A walker on a salt flat at dusk, on the cover · Generated With Diffusion Models · 原创
  • A fisherman mending a net · Generated With Diffusion Models · 原创
  • Pines in morning fog · Generated With Diffusion Models · 原创
  • A desert road between mesas · Generated With Diffusion Models · 原创
  • The salt flat at sunset, on the back cover · Generated With Diffusion Models · 原创
字体
Bodoni Moda (SIL OFL 1.1) · Source Serif 4 (SIL OFL 1.1) · Source Sans 3 (SIL OFL 1.1)
沙盒PDF