Zum Hauptinhalt springen
Rezept Nummer 189

Rezepte · Kapitel 10 · Ausgabe und Integration

Eine fünfte Farbe für die Hausfarbe

Vierfarbdruck plus ein exaktes Pantone als Hausfarbe: Die Farbtabelle legt jeden Namen des Blaus auf eine Platte, PANTONE 286 C.

Auf dieser Seite
Gattung
Berichte
Ausgabe
Canvas · PDF
Postext
Getestet mit Postext 1.84.0
Erfordert ≥ 1.84.0 · postext-pdf ≥ 1.84.0
Lizenz
Aktualisiert am 13. Nov. 2026
Code MIT · Text CC BY 4.0

S. 1 von 8

  • Englisches Beispiel: noch keine deutsche Ausgabe
  • Endformat 210 × 297 mm
  • 2 Spalten, Spaltenabstand 7 mm
  • Source Serif 4 9,6/13,2
  • Source Sans 3
  • 8 Seiten
  • Stufe
  • Postext 1.84.0
  • In 145 ms gesetzt
  • 298 Zeilen Code

Kurz gesagt

Der Jahresbericht einer Stiftung, die sich um einen Fluss kümmert, gedruckt mit den üblichen vier Farben und einem exakten Blau, der Farbe der Stiftung. Jede Datei nennt das Blau anders, und die Druckdatei legt es doch auf eine Platte.

Was Sie setzen

Ein achtseitiger Jahresbericht in A4 für eine erfundene Stiftung, die einen Fluss renaturiert, gedruckt in vier Farben und einer fünften, ihrem Hausblau. Das Blau steht dort, wo eine Marke es hinsetzen würde: das Band auf dem Umschlag, der Balken über jedem Abschnitt, die Überschriften, die Tabellenköpfe, die Balken des Diagramms und die Rückseite. Seine Rastertöne von 40 % und 12 % füllen die Planbalken, die Summenzeilen und den Kasten mit den Kennzahlen, und sie drucken als Raster derselben Farbe, nie als Mischung aus den Prozessfarben. Fotos und Text bleiben im Vierfarbdruck. Das PDF/X-4 hat fünf Platten, und die fünfte trägt den Namen, unter dem die Druckerei die Farbe führt, PANTONE 286 C, obwohl sie im Entwurf nirgends so heißt.

Dieses Rezept beantwortet

  • Wie drucke ich einen Bericht vierfarbig plus unsere Pantone-Hausfarbe, wenn jede Datei die Farbe anders nennt?

Die kurze Antwort

script.js · Zeilen 20–37im vollständigen Code
// The corporate blue as each source named it: the designer's swatch, an older palette that
// wrote it without the space, and the chart, drawn in Spanish, which says 'Azul Cauce'. The
// tints are the same ink at 40 % and 12 %: no process mix stands in for them.
const BLUE = { c: 100, m: 75, y: 0, k: 0 }; // what the ink looks like at 100 %, for a proof
const spot = (hex, name, tint) => ({ hex, model: 'spot', spot: { name, cmyk: BLUE, tint } });
const palette = {
  ink: { hex: '#1c2129', model: 'hex' }, // text, in process black
  muted: { hex: '#5d6573', model: 'hex' },
  blue: spot('#0033a0', 'Brand Blue'),
  blue40: spot('#99add9', 'Pantone 286C', 40),
  blue12: spot('#e0e6f3', 'Brand Blue', 12),
  ochre: { hex: '#c98a1b', model: 'hex' }, // the one process accent: the second data series
  paper: { hex: '#ffffff', model: 'hex' },
};
// The ink table: the plate's name is the printer's, and every other name prints on it.
const PRINT = { standard: 'pdfx4', outputProfile: 'fogra51', convertImages: false,
  inks: [{ name: 'PANTONE 286 C', aliases: ['Brand Blue', 'Pantone 286C', 'Azul Cauce'],
    cmyk: BLUE }] };

Zutaten

Schrift
Source Serif 4, Source Sans 3 (SIL OFL 1.1)
Dateien
  • director-800.jpg
  • kingfisher-1050.jpg
  • meander-1120.jpg
  • sample-900.jpg
  • volunteers-1200.jpg
  • The river from the air, on the cover (Generated With Diffusion Models, eigener Text)
  • The director on the river bank (Generated With Diffusion Models, eigener Text)
  • Volunteers planting willow stakes (Generated With Diffusion Models, eigener Text)
  • A water sample at a gauging station (Generated With Diffusion Models, eigener Text)
  • A kingfisher on a willow branch (Generated With Diffusion Models, eigener Text)

Zubereitung

#1 · Eine Farbe unter drei Namen

Der Code steht oben in der kurzen Antwort. Das Blau kommt unter drei Namen in den Bericht, wie bei echten Aufträgen: Das Farbfeld der Gestalterin heißt Brand Blue, eine ältere Palette schrieb Pantone 286C für den 40-%-Ton, und das Diagramm, im spanischen Büro gezeichnet, sagt Azul Cauce. Ohne Farbtabelle käme jeder Name auf eine eigene Platte, und die Druckerei bekäme drei Blaus zum Anmischen. Der Eintrag in der Farbtabelle benennt die Platte und führt die anderen Namen als Aliasse; die Namen werden ohne Rücksicht auf Groß- und Kleinschreibung und Leerzeichen verglichen, sodass jeder Rasterton jedes Namens auf dem einen Auszug PANTONE 286 C landet. Sein cmyk ist die Ersatzfarbe, die ein Proof zeigt.

#2 · Das Diagramm nennt seine Farbe

script.js · Zeilen 328–371im vollständigen Code
// Kilometres of bank restored each year: the bars in the blue (data-spot="Azul Cauce"), the
// plan in its 40 % tint, the labels in process black. An alias brings both onto the plate.
const YEARS = [[2021, 3.1, 4], [2022, 4.6, 5], [2023, 6.2, 6], [2024, 7.4, 8], [2025, 9.8, 9]];
function chartArt() {
  const [W, H, BASE, LEFT, MAX] = [84, 56, 46, 8, 12];
  const y = (v) => BASE - (v / MAX) * (BASE - 4);
  const lines = [0, 4, 8, 12].map((v) => `<path d="M${LEFT} ${y(v)}H${W}" stroke="#c4cad4" `
    + `stroke-width="0.2"/><text x="${LEFT - 1.5}" y="${y(v) + 1}" font-size="2.6" `
    + `text-anchor="end" fill="#5d6573">${v}</text>`).join('');
  const bars = YEARS.map(([year, done, plan], i) => {
    const x = LEFT + 3 + i * 15;
    return `<rect x="${x}" y="${y(plan)}" width="5" height="${BASE - y(plan)}" fill="#99add9" `
      + `data-spot="Azul Cauce" data-spot-tint="40"/><rect x="${x + 5.6}" y="${y(done)}" `
      + `width="5" height="${BASE - y(done)}" fill="#0033a0" data-spot="Azul Cauce"/>`
      + `<text x="${x + 5.3}" y="${BASE + 5}" font-size="2.8" text-anchor="middle" `
      + `fill="#1c2129">${year}</text>`;
  }).join('');
  return `<svg xmlns="http://www.w3.org/2000/svg" width="${W * 10}" height="${H * 10}" `
    + `viewBox="0 0 ${W} ${H}" font-family="'Source Sans 3'">${lines}${bars}</svg>`;
}
// Where each euro went: one bar across the text block, the river in the full ink, schools in
// its 40 % tint, the running costs in process grey.
const SPENT = [[1520, '#0033a0', 100, t({ en: 'Work on the river', es: 'Obras en el río' })],
  [340, '#99add9', 40, t({ en: 'Schools', es: 'Escuelas' })],
  [180, '#9aa1ad', 0, t({ en: 'Running costs', es: 'Funcionamiento' })]];
function euroArt() {
  const [W, H] = [174, 22];
  const total = SPENT.reduce((sum, [v]) => sum + v, 0);
  let x = 0;
  return `<svg xmlns="http://www.w3.org/2000/svg" width="${W * 10}" height="${H * 10}" `
    + `viewBox="0 0 ${W} ${H}" font-family="'Source Sans 3'">`
    + `${SPENT.map(([v, hex, tint, name], i) => {
      const w = (v / total) * W;
      const ink = tint ? ` data-spot="Azul Cauce" data-spot-tint="${tint}"` : '';
      const end = i === SPENT.length - 1; // the last label sets flush right, under its segment
      const tx = `x="${end ? W : x}" text-anchor="${end ? 'end' : 'start'}"`;
      const part = `<rect x="${x}" y="0" width="${w - 0.6}" height="10" fill="${hex}"${ink}/>`
        + `<text ${tx} y="15.5" font-size="3.2" font-weight="700" fill="#1c2129">`
        + `${Math.round((v / total) * 100)} %</text><text ${tx} y="20" font-size="2.8" `
        + `fill="#5d6573">${name}</text>`;
      x += w;
      return part;
    }).join('')}</svg>`;
}

Ein SVG gibt mit data-spot an, auf welcher Druckfarbe ein Farbton druckt, und mit data-spot-tint, wie stark, in Prozent. Die Balken des Diagramms nennen Azul Cauce mit 100 % und mit 40 %, und der Alias legt sie auf dieselbe Platte wie das übrige Blau. Gitterlinien und Beschriftungen sind gewöhnliche Farben und bleiben im Prozessschwarz. Der Ausgabenbalken auf der Finanzseite macht es ebenso mit drei Abschnitten, der dritte ein Grau aus den Prozessfarben.

#3 · Das Blau trägt die Gestaltung

script.js · Zeilen 55–73im vollständigen Code
const BAND = 172; // mm from the top of the bleed to the top of the blue band
const cover = { id: 'cover', numbered: false, toc: false, span: 'page',
  header: { elements: [] }, footer: { elements: [] },
  margins: { top: mm(0), bottom: mm(0), left: mm(0), right: mm(0) },
  advancedDesign: { enabled: true, minHeight: mm(TRIM_H), slot: { elements: [
    { kind: 'image', id: 'photo', resourceId: 'meander', fit: 'cover',
      placement: at('bleed', 'top-left', 0, 0, { width: 'fill', height: mm(BAND + 1) }) },
    { kind: 'box', id: 'band', style: { backgroundColor: col('blue') },
      placement: at('bleed', 'top-left', 0, BAND, { width: 'fill', height: mm(TRIM_H) }) },
    text('name', '{author}', label(10, col('paper')), at('page', 'top-left', 20, BAND + 14)),
    text('title', '{titleText}', { fontFamily: SANS, fontWeight: 800, fontSize: pt(46),
      lineHeight: 1, color: col('paper') }, at('#name', 'below', 0, 6, { width: mm(170) })),
    { kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(3), color: col('blue40'),
      placement: at('#title', 'below', 0, 7, { width: mm(24) }) },
    text('strap', '{attr.strap}', { fontFamily: 'Source Serif 4', italic: true, fontSize: pt(15),
      lineHeight: 1.3, color: col('paper') }, at('#rule', 'below', 0, 6, { width: mm(120) })),
    text('credit', '{attr.credit}', { fontFamily: SANS, fontSize: pt(7), color: col('blue40') },
      at('page', 'bottom-left', 20, -14, { width: mm(170) })),
  ] } } };

Das Umschlagfoto füllt mit fit: 'cover' den oberen Teil des Anschnitts, und ein Kasten im Blau füllt den Rest; die Schrift darauf ist weiß und spart die Platte aus. Abschnittsbalken, Fußzeilen und Tabellenköpfe verwenden denselben Paletteneintrag, ein Farbwechsel ist also eine Zeile.

script.js · Zeilen 315–324im vollständigen Code
// A row whose first cell is bold is a total: it takes the tint. Figures align right.
function tsvTable(tsv, columnWidths) {
  let m = Object.assign(parseTSV(tsv, { headerRows: 1 }), { columnWidths });
  m.rows.forEach((row, r) => row.forEach((_, c) => {
    if (c > 0) m = setAlignment(m, { row: r, col: c }, 'right', 'middle');
    if (r && row[0].content.startsWith('**')) m = setCellBackground(m, { row: r, col: c },
      col('blue12'));
  }));
  return m;
}

Die Tabellen kommen aus TSV-Dateien neben dem Text. Eine Zeile, deren erste Zelle fett ist, ist eine Summe und bekommt den 12-%-Ton; Zahlen stehen rechtsbündig.

#4 · Die Fotos bleiben in RGB

convertImages: false in den Druckeinstellungen lässt die Fotos als RGB-JPEGs mit sRGB-Profil, was PDF/X-4 erlaubt; das RIP der Druckerei separiert sie. Die Datei bleibt klein, und die blaue Platte bekommt nichts von den Fotos.

Das ganze Rezept

Sandbox
// ═══ Postext Cookbook · Nº 189 · A fifth ink for the corporate colour ═══════════════════
// https://postext.dev/en/cookbook/corporate-fifth-ink-report
// Code: MIT · Text: original (CC BY 4.0) · Photographs: diffusion models
// Fonts: Source Serif 4, Source Sans 3 (SIL OFL 1.1) · Needs postext ≥ 1.84.0
//
// An annual report printed in four colours and one exact corporate blue. The palette, the
// chart and an older swatch call the blue by three names; the ink table gathers them on one
// plate named as the printer stocks the ink, PANTONE 286 C.
import {
  buildDocumentWithFonts, renderPageToCanvas, registerResourceImage, parseTSV, setCellBackground,
  setAlignment, inlineSvgFonts,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'corporate-fifth-ink-report';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region answer: one spot ink, three names: the ink table puts them on one plate
// The corporate blue as each source named it: the designer's swatch, an older palette that
// wrote it without the space, and the chart, drawn in Spanish, which says 'Azul Cauce'. The
// tints are the same ink at 40 % and 12 %: no process mix stands in for them.
const BLUE = { c: 100, m: 75, y: 0, k: 0 }; // what the ink looks like at 100 %, for a proof
const spot = (hex, name, tint) => ({ hex, model: 'spot', spot: { name, cmyk: BLUE, tint } });
const palette = {
  ink: { hex: '#1c2129', model: 'hex' }, // text, in process black
  muted: { hex: '#5d6573', model: 'hex' },
  blue: spot('#0033a0', 'Brand Blue'),
  blue40: spot('#99add9', 'Pantone 286C', 40),
  blue12: spot('#e0e6f3', 'Brand Blue', 12),
  ochre: { hex: '#c98a1b', model: 'hex' }, // the one process accent: the second data series
  paper: { hex: '#ffffff', model: 'hex' },
};
// The ink table: the plate's name is the printer's, and every other name prints on it.
const PRINT = { standard: 'pdfx4', outputProfile: 'fogra51', convertImages: false,
  inks: [{ name: 'PANTONE 286 C', aliases: ['Brand Blue', 'Pantone 286C', 'Azul Cauce'],
    cmyk: BLUE }] };
// #endregion
const col = (id) => ({ ...palette[id], paletteId: id });
const colorPalette = [...Object.entries(palette).map(([id, value]) => ({ id, name: id, value })),
  { id: 'main-color', name: 'blue (defaults)', value: palette.blue }];

const [TRIM_W, TRIM_H] = [210, 297]; // A4
const MARGIN = { top: 24, bottom: 24, inner: 20, outer: 16 };
const LEAD = 13.2; // pt
const SANS = 'Source Sans 3';
const at = (to, edge, x = 0, y = 0, size) => ({ anchor: { to, edge },
  offset: { x: mm(x), y: mm(y) }, ...(size && { size }) });

Das zusammengesetzte script.js läuft unverändert: Fügen Sie es in das Modulskript einer beliebigen Seite ein, oder öffnen Sie das Rezept auf CodePen. Ordner des Rezepts auf GitHub ↗ (öffnet sich in einem neuen Tab)

Varianten

#Das Blau im Vierfarbdruck drucken

Hat die Maschine kein fünftes Druckwerk, druckt ein Wort in der Farbtabelle jeden Rasterton des Blaus in CMYK aus seiner Ersatzfarbe.

-  inks: [{ name: 'PANTONE 286 C', aliases: ['Brand Blue', 'Pantone 286C', 'Azul Cauce'],
-    cmyk: BLUE }] };
+  inks: [{ name: 'PANTONE 286 C', aliases: ['Brand Blue', 'Pantone 286C', 'Azul Cauce'],
+    cmyk: BLUE, output: 'process' }] };

#Die Platte für eine andere Druckerei benennen

Manche Druckereien wollen die Platte unter ihrem eigenen Namen. pdfName benennt sie um und behält die Aliasse.

-  inks: [{ name: 'PANTONE 286 C', aliases: ['Brand Blue', 'Pantone 286C', 'Azul Cauce'],
+  inks: [{ name: 'PANTONE 286 C', pdfName: 'PANTONE 286 U', aliases: ['Brand Blue', 'Pantone 286C', 'Azul Cauce'],

Häufige Fehler

  • Eine Farbe in einem Bild, die weder ihre Druckfarbe nennt noch genau einer Sonderfarbe der Palette entspricht, bleibt im Vierfarbdruck, auch wenn sie wie das Blau aussieht. Markieren Sie die Elemente mit data-spot, oder geben Sie der Palette eine Sonderfarbe mit genau diesem Hex-Wert.
  • Ein Familienname mit einer Ziffer, etwa Source Sans 3, braucht in der font-family eines SVG Anführungszeichen; ohne sie verwirft der Browser die Angabe und setzt die Beschriftungen in einer Serifenschrift.

Nachweise

Text
Eigener Text, CC BY 4.0
Bilder
  • The river from the air, on the cover · Generated With Diffusion Models · eigener Text
  • The director on the river bank · Generated With Diffusion Models · eigener Text
  • Volunteers planting willow stakes · Generated With Diffusion Models · eigener Text
  • A water sample at a gauging station · Generated With Diffusion Models · eigener Text
  • A kingfisher on a willow branch · Generated With Diffusion Models · eigener Text
Schriften
Source Serif 4 (SIL OFL 1.1) · Source Sans 3 (SIL OFL 1.1)
SandboxPDF