Vai al contenuto principale
Ricetta numero 225

Ricettario · Capitolo 10 · Output e integrazione

Una brossura KDP con la sua prova e la scheda di vendita

Pepita Jiménez in brossura KDP da 6 × 9 in su carta crema: il foglio con le misure di KDP, una prova con le guide, le cifre e la scheda controllata.

In questa pagina
Output
Canvas · PDF
Livello
Avanzato
Postext
Provata con Postext 1.104.0
Richiede ≥ 1.104.0 · postext-pdf ≥ 1.104.0
Licenza
Aggiornata il 4 dic 2026
Codice MIT · Testo CC BY 4.0

p. 1 · 10 di 10

  • Esempio in inglese: non c’è ancora un’edizione italiana
  • Formato 152,4 × 228,6 mm
  • 1 colonna
  • Spectral 10,5/15
  • Playfair Display
  • Work Sans
  • 10 pagine
  • Livello
  • Postext 1.104.0
  • Impaginato in 88 ms
  • 261 righe di codice

In breve

Un breve romanzo spagnolo in brossura stampato su richiesta da Amazon: la copertina stesa, la stessa con le linee guida della tipografia sopra, le sue misure, e parole chiave e descrizione del negozio controllate con le regole di Amazon.

Che cosa comporrai

Pepita Jiménez, il romanzo di Juan Valera del 1874, in brossura da 6 × 9 in stampata da Amazon KDP su carta crema: la traduzione inglese del 1886 in un’edizione, lo spagnolo di Valera nell’altra. Le pagine contengono un frontespizio, il colophon, la prefazione del curatore sotto un motto latino e la prima delle lettere di Luis de Vargas allo zio. La copertina è un unico foglio. Un fondo nero oliva corre sulla quarta e sul dorso, un dipinto del frutteto riempie la parte bassa della prima e sopra il titolo spicca in crema. KDP stampa il codice a barre dell’ISBN che assegna, quindi la quarta lascia libero il suo riquadro. Sopra le pagine, il pen disegna il foglio come prova con le guide di KDP e come si stampa, elenca le cifre del calcolatore di copertine di KDP e controlla le parole chiave e la descrizione del libro con le regole di KDP.

Questa ricetta risponde a

  • Come faccio la copertina di un tascabile KDP, con il dorso e il riquadro del codice a barre alle misure di KDP?
  • Come controllo le parole chiave e la descrizione del mio libro con le regole di Amazon prima di pubblicarlo?

La risposta breve

script.js · righe 31–54nel codice completo
// `binding` names a built-in profile: KDP's bleed (0.125 in), its spine of 0.0025 in a page
// on cream paper, its rule of no spine text under 79 pages, and the 2 × 1.2 in box on the
// back where KDP prints the barcode of the ISBN it assigns. `barcodeBy: 'printer'` keeps
// that box clear: the back's text frame ends above it, and anything the design put in it
// would be reported as `coverBarcodeZoneBusy`.
const production = {
  versions: [{ id: 'kdp', name: 'KDP paperback', binding: 'kdp-paperback-cream',
    barcodeBy: 'printer' }],
};
// The cover: an olive black ground over the whole wrap, the painting on the lower part of
// the front, and the title over the ground above it. The back takes the blurb, the spine
// the title and the author from the front matter.
const size = (width, height) => ({ x: 0, y: 0, width, height });
const cover = {
  background: col('night'),
  elements: [{ id: 'art', kind: 'image', zone: 'front', x: 0, y: 64, width: 155.6, height: 168,
    resourceId: 'orchard', fit: 'cover' }],
  verticalAlign: { back: 'middle' },
  textBoxes: [
    { name: 'author', rect: size(130, 8), anchor: { to: 'front', edge: 'top', y: 10 } },
    { name: 'title', rect: size(140, 22), anchor: { to: 'author', edge: 'below', y: 3 } },
    { name: 'subtitle', rect: size(130, 9), anchor: { to: 'title', edge: 'below', y: 1 } },
  ],
};

Ingredienti

Tipo
Spectral, Playfair Display, Work Sans (SIL OFL 1.1)
Risorse
  • pepita-1024.jpg
  • The cover painting: a young widow in black with a sprig of orange blossom by a fountain in an Andalusian orchard, and a seminarian among the orange trees behind her, in oils (Generated With Diffusion Models, originale)

Preparazione

#1 · I caratteri della copertina

script.js · righe 58–78nel codice completo
const style = (id, fontFamily, size, lead, color, extra) => ({ id, fontFamily, fontSize: pt(size),
  lineHeight: pt(lead), color, italicColor: color, boldColor: color, firstLineIndent: mm(0),
  textAlign: 'left', hyphenation: false, ...extra });
const mid = { textAlign: 'center' };
const caps = (tracking) => ({ fontWeight: 600, letterSpacing: pt(tracking) });
const narrow = { indent: mm(17), endIndent: mm(17) };
const coverStyles = [
  style('cover-author', 'Playfair Display', 14, 17, col('gold'), mid),
  style('cover-title', 'Playfair Display', 46, 50, col('bone'), { ...mid, fontWeight: 500 }),
  style('cover-subtitle', 'Spectral', 15, 19, col('gold'), { ...mid, italic: true }),
  style('cover-spine', 'Playfair Display', 10.5, 12, col('bone'), mid),
  // The back's frame runs across the panel: the blurb keeps a measure of 112 mm inside it.
  style('cover-blurb', 'Spectral', 11.5, 16, col('bone'), { textAlign: 'justify',
    hyphenation: true, firstLineIndent: mm(4), ...narrow }),
  style('cover-blurb-first', 'Spectral', 11.5, 16, col('bone'), { textAlign: 'justify',
    hyphenation: true, ...narrow }),
  style('cover-quote', 'Playfair Display', 16, 21, col('gold'), { ...mid, italic: true,
    marginTop: pt(14), marginBottom: pt(14) }),
  style('cover-note', 'Spectral', 10, 13, col('gold'), { ...mid, italic: true,
    marginTop: pt(12) }),
];

La risposta breve nomina kdp-paperback-cream, uno dei profili di stampa su richiesta di Postext: porta l’abbondanza di KDP di 0,125 in, il suo dorso di 0,0025 in per pagina su carta crema e il riquadro della quarta dove KDP mette il codice a barre. Gli stili di copertina danno solo i caratteri. La cornice della quarta occupa tutta l’area di sicurezza del pannello, così il testo di quarta mantiene una giustezza di 112 mm con indent e endIndent, e verticalAlign lo centra nello spazio sopra il riquadro del codice.

#2 · Il blocco del libro a 6 × 9 in

script.js · righe 82–124nel codice completo
const [W, H, TOP, FOOT, INNER, OUTER, LEAD] = [152.4, 228.6, 22, 22, 22, 18, 15]; // mm, pt
const at = (to, edge, x, y, box) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) },
  ...(box && { size: box }) });
const text = (id, content, look, place) => ({ kind: 'text', id, content, align: 'center',
  overflow: 'wrap', placement: place, ...look });
const face = (fontFamily, size, color, x) => ({ fontFamily, fontSize: pt(size), color, ...x });
const label = (size, color = col('muted')) => face('Work Sans', size, color,
  { ...caps(size / 6), textTransform: 'uppercase' });
const none = { header: { elements: [] }, footer: { elements: [] }, numbered: false, toc: false };
const design = (minHeight, elements) => ({ enabled: true, minHeight: mm(minHeight),
  slot: { elements } });
const page = (parity) => ({ breakBefore: { enabled: true, parity } });
const rule = (id, y, to = 'container') => ({ kind: 'rule', id, direction: 'horizontal',
  thickness: pt(0.6), color: col('accent'), placement: at(to, 'top', 0, y, { width: mm(14) }) });
const wide = { width: mm(W - INNER - OUTER) };
const headingStyles = [
  { ...none, ...page('odd'), id: 'title-page', advancedDesign: design(H - TOP - FOOT, [
    text('a', '{author}', label(9, col('accent')), at('page', 'top', 0, 52)),
    text('t', '{title}', face('Playfair Display', 32, col('ink'), { fontWeight: 500 }),
      at('page', 'top', 0, 62, wide)),
    text('s', '{subtitle}', face('Spectral', 13, col('muted'), { italic: true }),
      at('page', 'top', 0, 80)),
    rule('r', 92, 'page'),
    text('i', '{attr.imprint}', label(7.5), at('page', 'bottom', 0, -28)),
  ]) },
  { ...none, ...page('even'), id: 'rights', advancedDesign: design(120, [rule('r', 114)]) },
  // The editor's foreword opens under the title and its Latin motto, sunk 56 mm.
  { ...none, ...page('odd'), id: 'opener', advancedDesign: design(56, [
    text('t', '{titleText}', face('Playfair Display', 24, col('ink'), { fontWeight: 500 }),
      at('container', 'top', 0, 18, wide)),
    text('m', '{attr.motto}', face('Spectral', 11, col('muted'), { italic: true }),
      at('container', 'top', 0, 34, wide)),
    rule('r', 46)]) },
  // The first part on a recto: its numeral over its title, the letters below.
  { ...page('odd'), id: 'part', toc: false, advancedDesign: design(64, [
    text('n', '{attr.part}', face('Playfair Display', 15, col('accent')),
      at('container', 'top', 0, 17)),
    text('t', '{titleText}', face('Playfair Display', 19, col('ink'), { fontWeight: 500 }),
      at('container', 'top', 0, 28, wide)),
    rule('r', 46)]) },
];
const head = (id, content, parity) => text(id, content, { ...label(6.8), parity, pages: 'body' },
  at('page', 'top', 0, 12));

Il formato è il più comune di KDP, 152,4 × 228,6 mm, con un margine interno più largo per la legatura. Il frontespizio e le aperture prendono il testo dai metadati e dagli attributi dei titoli ({attr.imprint}, {attr.motto}, {attr.part}): il Markdown porta le parole, la configurazione i posti.

#3 · Le pagine del romanzo intero

script.js · righe 333–339nel codice completo
// The pen sets the novel's opening, not its 64,000 words. The spine needs the whole book,
// so the count is worked out from the words a page of this design holds: the body pages
// laid out here, the words they set, the novel's length, and four pages of front matter.
const WORDS = t({ en: 63750, es: 56790 }); // the whole text, Project Gutenberg 30236 / 17223
const body = markdown.split(/^# .*\{style="opener"/m)[1] ?? markdown;
const perPage = body.split(/\s+/).length / (book.pages.length - 2);
const pages = 4 + 2 * Math.ceil(WORDS / perPage / 2);

Il pen compone nove pagine: le pagine preliminari, la prefazione e la prima lettera, interrotta tra due paragrafi. Il dorso ha bisogno del libro intero, quindi il conto si ricava dalle parole che contiene una pagina di testo di questo progetto e dalla lunghezza del testo completo. L’edizione inglese arriva a 232 pagine, che danno un dorso di 0,580 in (14,73 mm). È una stima. Componi il libro intero e passa book.pages al posto del numero, e il dorso seguirà il conto reale.

#4 · Il foglio con le misure di KDP

script.js · righe 343–346nel codice completo
const built = buildCover({ config, version: 'kdp', pages, markdown: coverText,
  metadata: book.metadata, resources });
if (!('config' in built)) throw new Error(built.issues.map((i) => i.kind).join(', '));
const sheet = await buildDocumentWithFonts(built.content, built.config, kitFonts(FONTS));

buildCover riceve il numero di pagine, i metadati e il Markdown della copertina, e restituisce un documento la cui unica pagina è il foglio: 12,830 × 9,250 in nell’edizione inglese, abbondanza compresa. barcodeBy: 'printer' lascia vuoto il riquadro di 2 × 1,2 in di KDP, a 0,25 in dalla piega del dorso e dal piede, e la cornice di testo della quarta finisce sopra. Con 232 pagine il dorso riceve la sua scritta; sotto le 79 pagine KDP non ne ammette, e il controllo spineTextTooFewPages lo segnalerebbe.

#5 · Una prova con le guide di KDP

script.js · righe 353–378nel codice completo
// `coverGuideShapes` gives the trim, the folds, each panel's safe area and the barcode box
// in mm on the sheet; `paintGuides` draws them on any 2D canvas at so many pixels a mm.
const leaf = sheet.pages[0];
const views = document.createElement('section');
views.id = 'kdp';
views.style.cssText = 'display: grid; gap: 18px; padding: 24px 16px; color: #e8e2d6; '
  + 'grid-template-columns: repeat(auto-fit, minmax(300px, 620px)); justify-content: center; '
  + 'font: 14px/1.45 system-ui, sans-serif';
const figure = (caption, guides) => {
  const [fig, canvas, cap] = ['figure', 'canvas', 'figcaption']
    .map((tag) => document.createElement(tag));
  fig.style.cssText = 'margin: 0; min-width: 0';
  Object.assign(canvas, { role: 'img', ariaLabel: caption });
  renderPageToCanvas(leaf, sheet, canvas, { scale: 1240 / leaf.width });
  if (guides) {
    const ctx = canvas.getContext('2d');
    ctx.setTransform(1, 0, 0, 1, 0, 0);
    paintGuides(ctx, coverGuideShapes(built), canvas.width / built.sheet.width);
  }
  canvas.style.cssText = 'display: block; width: 100%; height: auto';
  cap.textContent = caption;
  fig.append(canvas, cap);
  views.append(fig);
};
figure(t({ en: 'The proof, with KDP’s guides', es: 'La prueba, con las guías de KDP' }), true);
figure(t({ en: 'The wrap as it prints', es: 'El pliego como se imprime' }), false);

coverGuideShapes restituisce il rifilo, le pieghe, l’area di sicurezza di ogni pannello e il riquadro del codice in mm sul foglio, e paintGuides li disegna sopra il foglio renderizzato. La prima figura è quella da mettere accanto al modello che il calcolatore di KDP fornisce per lo stesso formato, la stessa carta e lo stesso numero di pagine. Il PDF contiene le pagine e poi il foglio alla sua misura, senza guide.

#6 · Le cifre del calcolatore e la scheda

script.js · righe 382–400nel codice completo
const inch = (v) => `${(v / 25.4).toFixed(3)} in`;
const both = (w, h) => `${inch(w)} × ${inch(h)} · ${w.toFixed(1)} × ${h.toFixed(1)} mm`;
const zone = (name) => built.sheet.zones.find((z) => z.name === name).rect;
const spine = built.sheets.spine.used;
const rows = [
  [t({ en: 'Interior', es: 'Interior' }), t({ en: `Black ink, cream paper · ${pages} pages`,
    es: `Tinta negra, papel crema · ${pages} páginas` })],
  [t({ en: 'Trim', es: 'Formato' }), both(W, H)],
  [t({ en: 'Full cover', es: 'Cubierta completa' }), both(built.sheet.width, built.sheet.height)],
  [t({ en: 'Spine', es: 'Lomo' }), `${inch(spine)} · ${spine.toFixed(2)} mm`],
  [t({ en: 'Back · front', es: 'Contracubierta · cubierta' }),
    both(zone('back').width, zone('back').height)],
  [t({ en: 'Bleed', es: 'Sangrado' }), `${inch(built.sheet.bleed)} · ${built.sheet.bleed} mm`],
];
// The listing: the keywords, what a phone shows of the description, and KDP's verdict.
const keywords = listingKeywords(book.metadata);
const blurb = listingPreview(listingDescription(book.metadata));
const listing = built.issues.filter((i) => i.kind.startsWith('listing'));
const bytes = (s) => new TextEncoder().encode(s).length;

La tabella dà le misure che chiede il calcolatore di KDP, in pollici e in millimetri. La scheda viene dai metadati del contenuto: sette parole chiave, ognuna con la sua dimensione in byte UTF-8 rispetto ai 50 di KDP, e la descrizione come la mostra un telefono prima di Read more. I controlli della scheda qui non trovano nulla, quindi il pannello mostra la riga verde.

La ricetta completa

Sandbox
// ═══ Postext Cookbook · Nº 225 · A KDP paperback cover wrap with its proof and listing ═══
// https://postext.dev/en/cookbook/kdp-paperback-cover-wrap
// Code: MIT · Text: J. Valera, tr. 1886 (public domain) · Art: diffusion models
// Fonts: Spectral, Playfair Display, Work Sans (SIL OFL 1.1) · Needs postext ≥ 1.104.0
//
// Pepita Jiménez as a 6 × 9 in paperback printed by Amazon KDP on cream paper. The version
// names KDP's built-in binding profile, so the wrap comes out at KDP's measures: its bleed,
// a spine of 0.0025 in a page, the box KDP keeps on the back for its barcode. The pen draws
// the sheet as a proof with KDP's guides, lists the measures its cover calculator asks for,
// and reads the book's keywords and description against KDP's listing rules.
import { buildDocumentWithFonts, renderPageToCanvas, registerResourceImage, inlineSvgFonts }
  from 'https://esm.sh/postext';
import { buildCover, coverGuideShapes, paintGuides, listingKeywords, listingDescription,
  listingPreview } from 'https://esm.sh/postext/production';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'kdp-paperback-cover-wrap';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// The pages' colours, then the cover's: an olive black ground, cream type, an orange gold.
const palette = { ink: '#2a2420', accent: '#9c4222', muted: '#6e6259', paper: '#fbf6ec',
  rule: '#c9b79c', night: '#1f2620', bone: '#f3ead8', gold: '#dba65a' };
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
  ...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
  { id: 'main-color', name: 'accent (defaults)', value: { hex: palette.accent, model: 'hex' } },
];

// #region answer: the version names KDP's paperback profile on cream paper
// `binding` names a built-in profile: KDP's bleed (0.125 in), its spine of 0.0025 in a page
// on cream paper, its rule of no spine text under 79 pages, and the 2 × 1.2 in box on the
// back where KDP prints the barcode of the ISBN it assigns. `barcodeBy: 'printer'` keeps
// that box clear: the back's text frame ends above it, and anything the design put in it
// would be reported as `coverBarcodeZoneBusy`.
const production = {
  versions: [{ id: 'kdp', name: 'KDP paperback', binding: 'kdp-paperback-cream',
    barcodeBy: 'printer' }],
};
// The cover: an olive black ground over the whole wrap, the painting on the lower part of
// the front, and the title over the ground above it. The back takes the blurb, the spine
// the title and the author from the front matter.
const size = (width, height) => ({ x: 0, y: 0, width, height });
const cover = {
  background: col('night'),
  elements: [{ id: 'art', kind: 'image', zone: 'front', x: 0, y: 64, width: 155.6, height: 168,
    resourceId: 'orchard', fit: 'cover' }],
  verticalAlign: { back: 'middle' },

Lo script.js composto funziona così com’è: incollalo nello script modulo di qualsiasi pagina, oppure apri la ricetta su CodePen. Cartella della ricetta su GitHub ↗ (si apre in una nuova scheda)

Varianti

#Metti nella scheda una parola chiave che KDP rifiuta

bestselling è una delle affermazioni che KDP non consente, e la riga verde diventa listingKeywordBanned. Una parola chiave fatta solo di parole del titolo o dell’autore, come juan valera, dà invece listingKeywordInTitle.

 keywords:
   - "nineteenth-century Spanish novel"
   …
-  - "classic love story"
+  - "bestselling Spanish classic"

#Metti nel riquadro il codice a barre del libro

Con un ISBN del libro e barcodeBy: 'book', il riquadro riceve il suo codice a barre invece di restare libero per quello di KDP.

-  versions: [{ id: 'kdp', name: 'KDP paperback', binding: 'kdp-paperback-cream',
-    barcodeBy: 'printer' }],
+  versions: [{ id: 'kdp', name: 'KDP paperback', binding: 'kdp-paperback-cream',
+    isbn: '978-84-0000-225-1', barcodeBy: 'book' }],

#Stampa su carta bianca

La carta bianca di KDP è più sottile, 0,002252 in per pagina, e le stesse 232 pagine danno un dorso di 0,522 in.

-  versions: [{ id: 'kdp', name: 'KDP paperback', binding: 'kdp-paperback-cream',
+  versions: [{ id: 'kdp', name: 'KDP paperback', binding: 'kdp-paperback-white',

Errori frequenti

  • Qui il numero di pagine è una stima fatta su un campione del libro. KDP misura il dorso sul file che carichi, quindi costruisci la copertina definitiva dal libro composto.
  • Tutto ciò che il progetto mette nel riquadro del codice (il dipinto, un logo, una casella di testo) viene segnalato come coverBarcodeZoneBusy: il riquadro bianco di KDP ci verrebbe stampato sopra.
  • Le cifre del profilo vengono dalle pagine di aiuto di KDP. Se il modello di KDP non coincide, vale il modello: scrivi il suo dorso in spineOverride della versione.

Crediti

Testo
  • Pepita Ximenez, from the Spanish of Juan Valera, with an introduction by the author (D. Appleton and Company, New York, 1886), Project Gutenberg eBook #30236 · Juan Valera · pubblico dominio
  • Pepita Jiménez (Madrid, J. Noguera, 1874), Project Gutenberg eBook #17223 · Juan Valera · pubblico dominio
Immagini
  • The cover painting: a young widow in black with a sprig of orange blossom by a fountain in an Andalusian orchard, and a seminarian among the orange trees behind her, in oils · Generated With Diffusion Models · originale
Font
Spectral (SIL OFL 1.1) · Playfair Display (SIL OFL 1.1) · Work Sans (SIL OFL 1.1)
SandboxPDF