Em poucas palavras
Um romance espanhol curto em brochura impressa sob demanda pela Amazon: a capa aberta, a mesma com as linhas-guia da gráfica por cima, suas medidas, e as palavras-chave e a descrição da loja conferidas com as regras da Amazon.
O que você vai compor
Pepita Jiménez, o romance de Juan Valera de 1874, em brochura de 6 × 9 in impressa pela Amazon KDP em papel creme: a tradução inglesa de 1886 numa edição, o espanhol de Valera na outra. As páginas trazem folha de rosto, créditos, o prefácio do editor sob um lema em latim e a primeira das cartas de Luis de Vargas ao tio. A capa é uma folha só. Um fundo preto oliva corre pela contracapa e pela lombada, uma pintura do pomar ocupa a parte de baixo da capa e o título fica em creme acima dela. A KDP imprime o código de barras do ISBN que ela atribui, então a contracapa deixa esse espaço livre. Acima das páginas, o pen desenha a folha como prova com as guias da KDP e como ela é impressa, lista os números da calculadora de capas da KDP e confere as palavras-chave e a descrição do livro com as regras da KDP.
Esta receita responde a
- Como faço a capa de um livro de bolso da KDP, com a lombada e a caixa do código de barras nas medidas da KDP?
- Como verifico as palavras-chave e a descrição do meu livro com as regras da Amazon antes de publicar?
A resposta curta
// `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
- Funcionalidades
- Perfis de impressão sob demanda (KDP, IngramSpark, Lulu)Verificação da página de venda (palavras-chave, descrição)Folha de capaCapas, folhas de rosto e colofõesVersões impressas, ISBN e lombadaCaixas de texto da capaEstilos de títuloAberturas desenhadasTextos, fios e caixas nos designs de páginaMetadados do documentoEstilos de parágrafoCabeços e fóliosFiguras e tabelas como recursosPaleta de cores semânticaExportação para PDFPáginas em um canvas
- Também usa
- Atributos de títuloCor do papelCabeços por tipo de páginaFontes incorporadas ao PDFCabeços por seçãoCapítulos sem número
- Tipografia
- Spectral, Playfair Display, Work Sans (SIL OFL 1.1)
- Materiais
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, original)
Preparo
#1 · As letras da capa
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) }),
];
A resposta curta nomeia kdp-paperback-cream, um dos perfis de impressão sob demanda do Postext: ele traz a sangria da KDP, de 0,125 in, a lombada de 0,0025 in por página em papel creme e o espaço da contracapa onde a KDP põe o código de barras. Os estilos da capa só definem as letras. A moldura da contracapa ocupa toda a área segura do painel, então a sinopse mantém uma largura de 112 mm com indent e endIndent, e verticalAlign a centraliza no espaço acima do código de barras.
#2 · O miolo em 6 × 9 in
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));
É o formato mais comum da KDP, 152,4 × 228,6 mm, com a margem interna mais larga por causa da encadernação. A folha de rosto e as aberturas tiram o texto dos metadados e dos atributos dos títulos ({attr.imprint}, {attr.motto}, {attr.part}): o Markdown traz as palavras, a configuração os lugares.
#3 · O número de páginas do romance inteiro
// 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);
O pen compõe nove páginas: os elementos pré-textuais, o prefácio e a primeira carta, cortada entre dois parágrafos. A lombada precisa do livro inteiro, então a conta sai das palavras que cabem numa página de texto deste projeto e do tamanho do texto completo. A edição inglesa chega a 232 páginas, o que dá uma lombada de 0,580 in (14,73 mm). É uma estimativa. Componha o livro inteiro e passe book.pages no lugar do número, e a lombada vai seguir a contagem real.
#4 · A folha com as medidas da KDP
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 recebe o número de páginas, os metadados e o Markdown da capa, e devolve um documento cuja única página é a folha: 12,830 × 9,250 in em inglês, com a sangria. barcodeBy: 'printer' deixa vazio o espaço de 2 × 1,2 in da KDP, a 0,25 in da dobra da lombada e do pé, e a moldura de texto da contracapa termina acima dele. Com 232 páginas a lombada recebe texto; abaixo de 79 páginas a KDP não permite, e a verificação spineTextTooFewPages avisaria.
#5 · Uma prova com as guias da KDP
// `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 devolve o refile, as dobras, a área segura de cada painel e o espaço do código de barras em mm sobre a folha, e paintGuides os desenha por cima da folha renderizada. A primeira figura é a que você coloca ao lado do modelo que a calculadora da KDP gera para o mesmo formato, papel e número de páginas. O PDF traz as páginas e depois a folha no tamanho dela, sem guias.
#6 · Os números da calculadora e a página de venda
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;
A tabela dá as medidas que a calculadora da KDP pede, em polegadas e em milímetros. A página de venda sai dos metadados do conteúdo: sete palavras-chave, cada uma com seu tamanho em bytes UTF-8 diante do limite de 50 da KDP, e a descrição como um celular a mostra antes de Read more. As verificações da página de venda não acham nada nesta, então o painel mostra a linha verde.
A receita completa
// ═══ 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' },
O script.js montado funciona como está: cole-o como script de módulo em qualquer página ou abra a receita no CodePen. Pasta da receita no GitHub ↗ (abre em uma nova aba)
Variações
#Ponha na página de venda uma palavra-chave que a KDP recusa
bestselling é uma das alegações que a KDP não aceita, e a linha verde vira listingKeywordBanned. Uma palavra-chave feita só de palavras do título ou do autor, como juan valera, dá listingKeywordInTitle.
keywords:
- "nineteenth-century Spanish novel"
…
- - "classic love story"
+ - "bestselling Spanish classic"#Ponha no espaço o código de barras do próprio livro
Com um ISBN do livro e barcodeBy: 'book', o espaço recebe o código de barras dele em vez de ficar livre para o da 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' }],#Imprima em papel branco
O papel branco da KDP é mais fino, 0,002252 in por página, e as mesmas 232 páginas dão uma lombada de 0,522 in.
- versions: [{ id: 'kdp', name: 'KDP paperback', binding: 'kdp-paperback-cream',
+ versions: [{ id: 'kdp', name: 'KDP paperback', binding: 'kdp-paperback-white',Erros comuns
- Aqui o número de páginas é uma estimativa feita com uma amostra do livro. A KDP mede a lombada no arquivo que você envia, então monte a capa final a partir do livro composto.
- O que o projeto puser no espaço do código de barras (a pintura, um logotipo, uma caixa de texto) gera o aviso
coverBarcodeZoneBusy: o retângulo branco da KDP seria impresso por cima. - Os números do perfil vêm das páginas de ajuda da KDP. Se o modelo da KDP for diferente, vale o modelo: escreva a lombada dele em
spineOverrideda versão.
Créditos
- Receita
- Ignacio Ferro
- Texto
- 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 · domínio público
- Pepita Jiménez (Madrid, J. Noguera, 1874), Project Gutenberg eBook #17223 · Juan Valera · domínio público
- Imagens
- 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 · original
- Fontes
- Spectral (SIL OFL 1.1) · Playfair Display (SIL OFL 1.1) · Work Sans (SIL OFL 1.1)
- Código
- MIT, como o Postext
Editar este texto ↗ (abre em uma nova aba)Pasta da receita no GitHub ↗ (abre em uma nova aba)


