Saltar al contenido principal
Receta número 225

Recetario · Capítulo 10 · Salida e integración

Una rústica de KDP con su prueba y su ficha de venta

Pepita Jiménez en rústica de 6 × 9 in para KDP en papel crema: el pliego con las medidas de KDP, una prueba con guías, las cifras y la ficha revisada.

En esta página
Salida
Canvas · PDF
Postext
Probada con Postext 1.104.0
Requiere ≥ 1.104.0 · postext-pdf ≥ 1.104.0
Licencia
Actualizada el 4 dic 2026
Código MIT · Texto CC BY 4.0

p. 1 · 10 de 10

  • Formato 152,4 × 228,6 mm
  • 1 columna
  • Spectral 10,5/15
  • Playfair Display
  • Work Sans
  • 10 páginas
  • Nivel
  • Postext 1.104.0
  • Compuesto en 82 ms
  • 261 líneas de código

En pocas palabras

Una novela española corta en rústica impresa bajo demanda por Amazon: la cubierta extendida, la misma con las guías de la imprenta encima, sus medidas, y las palabras clave y la descripción de la tienda revisadas con sus reglas.

Lo que vas a componer

Pepita Jiménez, la novela de Juan Valera de 1874, en rústica de 6 × 9 in impresa por Amazon KDP en papel crema: el texto de Valera en una edición y la traducción inglesa de 1886 en la otra. Las páginas traen portada, créditos, el prólogo del editor bajo un lema latino y la primera carta de Luis de Vargas a su tío. La cubierta es un solo pliego. Un fondo negro oliváceo recorre la contracubierta y el lomo, un cuadro de la huerta ocupa la parte baja de la cubierta y el título va en crema encima. KDP imprime el código de barras del ISBN que asigna, así que la contracubierta deja libre su caja. Sobre las páginas, el pen dibuja el pliego como prueba con las guías de KDP y como se imprime, da las cifras de la calculadora de cubiertas de KDP y revisa las palabras clave y la descripción con las reglas de KDP.

Esta receta responde a

  • ¿Cómo hago la cubierta de una rústica de KDP, con el lomo y la caja del código de barras a las medidas de KDP?
  • ¿Cómo reviso las palabras clave y la descripción de mi libro con las reglas de Amazon antes de publicarlo?

La respuesta corta

script.js · líneas 31–54en el código 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 } },
  ],
};

Ingredientes

Tipografía
Spectral, Playfair Display, Work Sans (SIL OFL 1.1)
Recursos
  • pepita-1024.jpg
  • La pintura de cubierta: una viuda joven de negro con una ramita de azahar junto a una fuente en una huerta andaluza, y un seminarista entre los naranjos, detrás de ella, al óleo (Generated With Diffusion Models, original)

Elaboración

#1 · La letra de la cubierta

script.js · líneas 58–78en el código 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 respuesta corta nombra kdp-paperback-cream, uno de los perfiles de impresión bajo demanda de Postext: trae el sangrado de KDP, 0,125 in, su lomo de 0,0025 in por página en papel crema y la caja de la contracubierta donde KDP pone su código de barras. Los estilos de la cubierta solo dan la letra. El marco de la contracubierta ocupa toda la zona segura del panel, así que la sinopsis guarda una medida de 112 mm con indent y endIndent, y verticalAlign la centra en el espacio que queda sobre la caja del código.

#2 · El cuerpo del libro en 6 × 9 in

script.js · líneas 82–124en el código 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));

Es el formato más común de KDP, 152,4 × 228,6 mm, con el margen interior más ancho por la encuadernación. La portada y las aperturas toman su texto de los metadatos y de los atributos del título ({attr.imprint}, {attr.motto}, {attr.part}): el Markdown pone las palabras y la configuración los sitios.

#3 · Las páginas de la novela entera

script.js · líneas 325–331en el código 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);

El pen compone nueve páginas: los preliminares, el prólogo y la primera carta, cortada entre dos párrafos. El lomo necesita el libro entero, así que la cuenta sale de las palabras que caben en una página de texto de este diseño y de la extensión del texto completo. Salen 232 páginas, con un lomo de 0,580 in (14,73 mm). Es una estimación. Compón el libro entero y pasa book.pages en vez del número, y el lomo seguirá la cuenta real.

#4 · El pliego con las medidas de KDP

script.js · líneas 335–338en el código 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 recibe la cuenta de páginas, los metadatos y el Markdown de la cubierta, y devuelve un documento cuya única página es el pliego: 12,830 × 9,250 in con el sangrado. barcodeBy: 'printer' deja vacía la caja de 2 × 1,2 in de KDP, a 0,25 in del pliegue del lomo y del pie, y el marco de la contracubierta acaba encima. Con 232 páginas el lomo lleva texto; por debajo de 79 páginas KDP no lo admite, y el aviso spineTextTooFewPages lo diría.

#5 · Una prueba con las guías de KDP

script.js · líneas 345–370en el código 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 devuelve el corte, los pliegues, la zona segura de cada panel y la caja del código en milímetros sobre el pliego, y paintGuides los dibuja encima del pliego ya pintado. La primera figura es la que se pone junto a la plantilla que da la calculadora de KDP para el mismo formato, papel y número de páginas. El PDF lleva las páginas y después el pliego a su tamaño, sin guías.

#6 · Las cifras de la calculadora y la ficha

script.js · líneas 374–392en el código 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 tabla da las medidas que pide la calculadora de KDP, en pulgadas y en milímetros. La ficha sale de los metadatos del contenido: siete palabras clave, cada una con su tamaño en bytes UTF-8 frente a los 50 de KDP (una letra con tilde ocupa dos), y la descripción tal como la enseña un móvil antes de Leer más. Las revisiones de la ficha no encuentran nada en esta, así que el panel muestra la línea verde.

La receta 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 = 'es'; // @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' },

El script.js compuesto funciona tal cual: pégalo como script de módulo en cualquier página o abre la receta en CodePen. Carpeta de la receta en GitHub ↗ (se abre en una nueva pestaña)

Variantes

#Pon en la ficha una palabra clave que KDP rechaza

más vendido no está en la lista de KDP, que es inglesa; bestselling sí, y la línea verde pasa a listingKeywordBanned. Una palabra clave hecha solo de palabras del título o del autor, como juan valera, da listingKeywordInTitle.

 keywords:
   - "novela epistolar"
   …
-  - "clásicos de la literatura española"
+  - "bestselling Spanish classic"

#Pon en la caja el código de barras del libro

Con un ISBN del libro y barcodeBy: 'book', la caja lleva su código en vez de quedar libre para el de 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' }],

#Imprime en papel blanco

El papel blanco de KDP es más fino, 0,002252 in por página, y las mismas 232 páginas dan un lomo de 0,522 in.

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

Errores frecuentes

  • Aquí la cuenta de páginas es una estimación hecha con una muestra del libro. KDP mide el lomo sobre el archivo que subes, así que construye la cubierta final con el libro compuesto.
  • Lo que el diseño ponga en la caja del código (el cuadro, un logotipo, una caja de texto) se avisa como coverBarcodeZoneBusy: la caja blanca de KDP se imprimiría encima.
  • Las cifras del perfil salen de las páginas de ayuda de KDP. Si la plantilla de KDP no coincide, manda la plantilla: escribe su lomo en spineOverride de la versión.

Créditos

Texto
  • Pepita Ximenez, traducción inglesa de Pepita Jiménez de Juan Valera, con un prólogo del autor (D. Appleton and Company, Nueva York, 1886), libro electrónico n.º 30236 del Proyecto Gutenberg · Juan Valera · dominio público
  • Pepita Jiménez (Madrid, J. Noguera, 1874), libro electrónico n.º 17223 del Proyecto Gutenberg · Juan Valera · dominio público
Imágenes
  • La pintura de cubierta: una viuda joven de negro con una ramita de azahar junto a una fuente en una huerta andaluza, y un seminarista entre los naranjos, detrás de ella, al óleo · Generated With Diffusion Models · original
Fuentes
Spectral (SIL OFL 1.1) · Playfair Display (SIL OFL 1.1) · Work Sans (SIL OFL 1.1)
SandboxPDF