Skip to main content

Chapter 14 · Part II · The craft

Print covers

A book's print versions, each with its binding, ISBN and spine; binding and paper profiles from the printer; the cover sheet with its flaps, jacket, case and endpapers; the cover's design and finishes; its Markdown text; and the cover from the Sandbox, the command line and code

Updated 2026-11-2319 minenescadefritptzhjaar

In short

This page is about the cover of a printed book: the sheet that wraps the pages, with the back, the spine and the front, and sometimes flaps, a dust jacket or endpapers. A book can be printed in several versions, such as a paperback and a hardcover, and each version has its own binding and its own ISBN. Postext works out how wide the spine is from the number of pages and the paper, and builds the sheet at the size the printer needs, with the bleed and the fold marks. The design of the cover lives in the settings and its texts in a Markdown document, and the title and author come from the book's own details. The page shows how to do all this in the Sandbox, from the command line and from code.

A book's print versions live in its production settings; the cover's design is the cover setting; its text is a Markdown document of the book.

The pages of a book are one thing and the sheet that wraps them is another. The cover sheet is wider than two pages: it carries the back cover, the spine and the front cover side by side, sometimes flaps, and it changes with every reprint that changes the page count or the paper. Postext builds it from three parts of the book:

  • The production: the versions the book is printed in (a paperback, a hardcover), each with its binding, its ISBN and its spine. It belongs to the book, not to its design, and nothing in the layout of the pages reads it.
  • The cover's design: grounds, pictures, boxes, logos, text boxes and finishes, placed on the panels of the sheet. It is a part of the design, shared by every version of the book and by the books of a collection.
  • The cover's text: a Markdown document with one block per panel. The front and the spine that it leaves empty take the title, subtitle and author from the book's metadata on every build, so a corrected title reaches the cover without copying it.

From these three, the cover is laid out by the same engine as the pages, and the PDF goes to the printer with the sheet's bleed and fold marks.

#Versions of a book

A version is the book as one binding makes it. A novel published as a paperback and as a hardcover has two versions over the same pages: each has its own binding, its own ISBN and its own cover sheet.

import type { PostextConfig } from 'postext';
 
const config: PostextConfig = {
  page: { width: { value: 150, unit: 'mm' }, height: { value: 230, unit: 'mm' } },
  folio: { paper: { type: 'uncoated', grammage: 90, bulk: 1.3 } },
  production: {
    versions: [
      { id: 'paperback', name: 'Paperback', binding: 'perfect', isbn: '978-84-0000-000-4', flaps: true },
      {
        id: 'hardcover', name: 'Hardcover', binding: 'case-flat', isbn: '978-84-0000-001-1',
        flaps: true, // on a case: a dust jacket
        caseMaterial: 'cloth',
        spineText: { direction: 'topToBottom' },
      },
    ],
  },
};

Each version names its binding by a profile's id, or carries the profile itself. The fields:

  • id and name: how the version is chosen (the command line's --print-version) and shown.
  • binding: a binding profile (below).
  • isbn: this version's ISBN, ISBN-10 or ISBN-13, with or without hyphens. Each binding of a book has its own. A valid one prints as a barcode on the back of the outermost sheet: the dust jacket of a case that wears one, else the case or the softcover.
  • isbnAddOn: five digits printed after the barcode. In Spain it carries no price: the ISBN agency allows it only starting with 9, for the publisher's own use (90000 means no price).
  • workIsbn: the ISBN of the whole work, for a volume of a collection or of a work in several volumes. The barcode carries the volume's isbn; this one is printed as text beside it. Without it, the collection's isbn is printed there.
  • flaps: on a softcover, flaps; on a case, a dust jacket.
  • caseMaterial: on a case, printed (the cover printed and laminated over the boards, the default) or cloth (stamped, usually under a jacket).
  • overrides: measures in mm this version sets for itself over its profile's, when the printer asks for a different joint on this one book.
  • spineOverride: the spine in mm as the printer gives it, in place of the calculated one.
  • spineText: how the spine is lettered: direction rising (bottomToTop, the usual way in Spain and the default) or falling (topToBottom, as ISO 6357 prefers), and minSpine, the narrowest spine that takes text (6 mm by default).

production.collection names the collection or multi-volume work the book belongs to:

production: {
  collection: {
    name: 'Library of the Sea',
    isbn: '978-84-0000-010-3',
    catalogue: [
      { id: 'reefs', title: 'Reefs', resource: 'cover-reefs' },
      { id: 'tides', title: 'Tides', resource: 'cover-tides' },
      { id: 'abyss', title: 'The Abyss', resource: 'cover-abyss' },
    ],
    volume: 'tides',
  },
},
  • name: the collection's name.
  • isbn: the whole work's ISBN, printed as text beside the barcode of a version that names no workIsbn of its own.
  • catalogue: the collection's titles in order, each with an id, a title and an optional picture resource (usually its front cover). ::catalogue in the cover's text sets them as lines, and a catalogue element of the design as pictures, on the endpapers or the back cover.
  • volume: the id of the catalogue entry that is this book, marked wherever the catalogue is set. A volume that names no entry is reported by the configuration checks.

#Binding profiles

A binding profile describes how a printer binds: a style, its measures and what it can make. Postext comes with one generic profile per style, on signatures of 16 pages:

IdStyleWhat it is
perfectperfectA softcover glued at the spine (PUR or hot melt). It takes spines from 3 to 50 mm.
sewn-softcoversewnSoftcoverA softcover over sewn signatures.
case-flatcaseFlatA hardcover with a flat spine.
case-roundcaseRoundA hardcover with a rounded spine.

The measures of these profiles come from printers' and binders' published specifications; where they disagree, the value most of them give. They are a starting point. A printer's own go in a profile of the book, in production.bindings, which travels with the book so a bundle opened elsewhere still finds it:

production: {
  bindings: [{
    id: 'my-printer-perfect',
    name: 'Perfect bound, my printer',
    printer: 'Gráficas Ejemplo',
    style: 'perfect',
    signature: 32,
    measures: { bleed: 5, hingeScore: 7, flapWidth: { ratio: 0.6, of: 'width', min: 70, max: 110 } },
    accepts: { trim: { max: { width: 240, height: 320 } }, spine: { min: 4, max: 45 } },
  }],
  versions: [{ id: 'paperback', name: 'Paperback', binding: 'my-printer-perfect' }],
},
  • style: perfect, sewnSoftcover, caseFlat or caseRound.
  • signature: pages per signature. The page count is rounded up to whole signatures for the spine, and the check says how many blank pages that adds.
  • measures: any left out take the defaults of the style.
  • accepts: the smallest and largest trim (trim.min, trim.max, each a width and a height in mm) and the thinnest and thickest spine (spine.min, spine.max) the printer can bind. A book outside them gets a check instead of a cover nobody can bind.

Every measure is in mm, written in one of three ways so that one profile serves every trim:

  • A number: the same for any trim (a 3 mm square).
  • Steps: a list of { upTo: { width, height }, mm }, the first step whose upTo the trim fits in, and the last one, without upTo, for anything larger. A printer that thickens the board on big books writes it this way.
  • A share of the trim: { ratio, of, min, max }, a ratio of the trim's width (the default) or height, kept between min and max. Flaps are usually written this way.
MeasureApplies toWhat it isDefault
spineAllowanceallAdded to the thickness of the pages: glue, sewing and, on a softcover, the cover board round it.0.5
bleedsoftcoverBleed round the cover sheet.3
hingeScoresoftcoverDistance of the hinge scores from each spine fold (0: scored only at the spine).6
flapWidthsoftcoverWidth of each flap.2/3 of the width, 65 at least
flapFoldInsetsoftcoverHow much narrower than the trim each cover panel is made, so the flap folds just inside the fore-edge.2
boardcaseBoard thickness.2 up to 150 × 230, 2.5 up to 216 × 280, 3 above
squarecaseHow far the boards stand out from the pages at head, foot and fore-edge.3
jointcaseThe hinge gap between each board and the spine.7
turnIncaseThe cover material turned in round the boards.15
boardSetbackcaseHow much narrower than the trim each board is cut at the spine side, before the square is added at the fore-edge.7
caseSpineAllowancecaseAdded to the pages and two boards for the width of the spine board.0
roundSpineAllowanceround caseAdded to the flat case spine for the round.3
jacketFoldAllowancejacketExtra width at each fore-edge fold, for the board it wraps.3
jacketFlapWidthjacketWidth of each jacket flap.2/3 of the width, 80 at least
jacketBleedjacketBleed round the jacket.3
endpaperGlueStripendpapersGlue strip along the fold, tipped onto the pages.5
endpaperBleedendpapersBleed at head, foot and fore-edge (none at the fold).3
safeMarginallKept clear of text inside each fold, score, joint and trim.5
designMarginallHow far past the trim the design is drawn before a mirrored bleed takes over (below).5

#Paper and the spine

The spine is the thickness of the pages plus the binding's allowance. A leaf (two pages) is as thick as its paper's grammage times its bulk, in micrometres: 90 g/m² at a bulk of 1.3 makes a leaf of 0.117 mm. The pages are the book as laid out, rounded up to whole signatures. Each page is counted on its own paper: the book's paper is folio.paper, and a run of pages on another stock (a :::paper block, a section of coated plates) counts with its own, by the same rule Folio uses to show the book.

So the spine follows the book. When an edit adds a signature, the spine grows, the sheet widens, and every element placed on the front or the back moves with its panel. When the printer measures a dummy and gives a figure, spineOverride sets it, and the check notes both numbers. A spine under spineText.minSpine carries no text.

A paper of the book can also be kept as a profile, in production.papers: the stock Folio knows (type, grammage, bulk, its finish and shade) with an id, a name, its supplier and its commercialName.

#Profiles from one book to another

Binding and paper profiles move between books, and between people, as a .postext-production.json file. exportProductionProfiles(papers, bindings) writes one, and importProductionProfiles(data) reads one back with the issues of the entries it left out. The Sandbox's Cover panel has both as buttons.

#The sheet and its panels

The sheet is made of panels, called zones, side by side, each what that part of the sheet becomes once folded:

SheetZones, left to right
SoftcoverflapBack (with flaps), back, spine, front, flapFront (with flaps)
Caseback, jointBack, spine, jointFront, front, with the turn-in round them
Dust jacketflapBack, back, spine, front, flapFront
Endpaperpastedown, hinge, flyleaf

A softcover version has one sheet, its cover. A case has its covering, a jacket when flaps is on, and a front and a back endpaper. A book bound on the right (set right to left, a vertical Chinese or Japanese book, or page.binding: 'right') has its sheet mirrored: the front panel on the left, the back on the right. A vertical book's zones are set in vertical lines, the spine's running down it without a turn, so spineText.direction does not apply.

Each zone has a safe area inside it, safeMargin in from every fold and trim, and the spine's own narrower margin across it. The Sandbox draws the folds, the scores and the safe areas over the sheet; the PDF draws fold marks in the slug outside the bleed.

#The cover's design

The cover setting is the cover's design. Like the rest of the design, it does not say what the cover reads, only how it looks, and it does not change the layout of the pages:

cover: {
  background: { hex: '#1f3f99', model: 'hex' },
  image: { resourceId: 'cover-art', area: 'front', focus: { x: 0.5, y: 0.35 } },
  zones: { spine: { hex: '#14295f', model: 'hex' } },
  verticalAlign: { front: 'bottom', back: 'middle' },
  barcodeMagnification: 0.9,
  mirrorMargin: 5,
},
  • background: the ground of the whole sheet.
  • image: a bitmap or SVG resource of the book filling the whole sheet (area: 'sheet', the default) or only the front cover ('front'), cropped to cover it about focus (fractions of the picture).
  • zones: a ground per zone, over the sheet's ground and its picture.
  • verticalAlign: where each zone's text sits in it: top (the default), middle or bottom. The spine's text is always centred across it.
  • barcodeMagnification: the barcode's size against the nominal one, from 0.8 to 2 (default 1). Below 0.8 it is set at 0.8 and the check says so.
  • mirrorMargin: the mirrored bleed (below).

#Elements, effects and logos

Over the grounds, the design places three lists of items, each drawn back to front: elements under the text, effects over it, and logos over everything. An item is a picture (kind: 'image' with a resourceId), a box of colour ('box'), a shape of colour ('shape') or the collection's catalogue ('catalogue', below), and has an id of letters, digits, - and _.

An item is placed by the zone it stands in, so it moves with that zone when the spine grows or the binding changes:

elements: [
  { id: 'band', kind: 'box', zone: 'back', x: -3, y: 180, width: 0, height: 24,
    to: { zone: 'front', x: 153 }, color: { hex: '#d8a21b', model: 'hex' } },
  { id: 'seal', kind: 'shape', zone: 'front', x: 100, y: 20, width: 30, height: 30,
    basis: { width: 150, height: 230 }, color: { hex: '#ffffff', model: 'hex' }, opacity: 0.8,
    path: [{ closed: true, nodes: [{ x: 0.5, y: 0 }, { x: 1, y: 1 }, { x: 0, y: 1 }] }] },
],
logos: [{ id: 'publisher', kind: 'image', zone: 'spine', x: 1, y: 205, width: 8, height: 12,
  resourceId: 'logo', clearance: 2 }],
  • zone, x, y, width, height: its box, in mm from the zone's top-left corner. It may run out of the zone, onto the next ones or into the bleed.
  • basis: the size of its zone when it was placed. When the zone is another size now, because the book's format changed or the spine grew, the item scales with it: a box or a shape on each axis, a picture evenly about its centre, keeping its proportions. Without it, the item stays as placed.
  • to: a box or shape that runs across zones, such as a band from the back to the front: its right edge, in mm from the left of the zone it ends in (to.zone, to.x), and that zone's width when it was placed (to.basis). Each edge then follows its own zone.
  • color and opacity: a box's or a shape's colour, and the opacity of any item (0 to 1). A picture keeps its own transparency.
  • fit: how a picture fills its box: whole inside it (contain, the default) or covering it, cropped (cover).
  • path: a shape drawn by nodes, in fractions of its box (0, 0 its top-left corner; 1, 1 its bottom-right), so the shape stretches with the box. Each part has its nodes and is closed or open; a node has x and y, and the handles of the curve that comes into it (in) and leaves it (out).
  • outline: closed polygons in fractions of the box, traced from a picture, for a veil or a finish in its shape.
  • clip: a picture cut to an outline, so a picture shows only within its illustration's own shape.
  • bleed: past the design margin of a mirrored bleed, mirror (the default) folds the item out with the ground; own paints it as it is, over the fold.
  • clearance (logos): the clear space in mm nothing else should enter round the logo.

A box or a shape can also carry the effects a page's box style cannot draw: radius for rounded corners in mm, stroke for a border (color and width in mm), gradient from its colour to to at angle degrees (0: left to right; 90: top to bottom), and shadow (color, opacity, how far it falls x and y in mm, and how soft it is, blur). A gradient or a shadow makes the item a picture of its own, drawn at the PDF's resolution.

A catalogue item lays out the pictures of the collection's titles in a grid inside its box, so the series can be shown on an endpaper without placing each cover by hand:

elements: [
  { id: 'series', kind: 'catalogue', zone: 'flyleaf', x: 15, y: 40, width: 120, height: 150,
    columns: 3, gap: 4, stroke: { color: { hex: '#d8a21b', model: 'hex' }, width: 0.8 } },
],
  • columns: pictures per row (by default every title in one row).
  • gap: the space between the pictures, in mm (3 by default).
  • first and last: the first and last titles shown, by their place in the catalogue counting from 1, to share a long catalogue between two pages (by default all of them).
  • fit: each picture covers its cell, cropped (cover, the default here), or sits whole inside it (contain).
  • stroke and radius: the border that outlines the book's own title (collection.volume). Without a stroke it is not marked.

A title without a resource leaves its cell empty, and a collection without a catalogue draws nothing. With a basis, the cells scale with the zone as the item does.

#Mirrored bleed

A cover's art usually stops at the trim, and a case's turn-in runs 15 mm past it, round the board. With mirrorMargin, the design is drawn that many mm past the trim (2 at the least), and beyond it the ground and the elements are mirrored out to the sheet's edge, so the turn-in and the bleed continue the picture instead of showing a blank strip. A profile's designMargin gives the margin a printer expects. An element marked bleed: 'own' is not mirrored.

#Text boxes

Each zone is a text frame of its own. textBoxes adds frames placed by hand, for a quotation across the front, a line on the spine's foot or a caption over a picture:

textBoxes: [
  { name: 'praise', rect: { x: 18, y: 30, width: 110, height: 40 }, verticalAlign: 'middle' },
  { name: 'spine-foot', rect: { x: 158, y: 200, width: 6, height: 25 }, rotate: -90 },
],
  • name: letters, digits, - and _, and not a zone's name. The cover's Markdown fills the box by it.
  • rect: its place on the sheet, in mm from the corner of the bleed.
  • rotate: -90 turns the text a quarter to read up a spine, 90 to read down it.
  • verticalAlign: top, middle or bottom.

#Finishes and technical plates

finishes are what the printer adds after the inks, each over a shape of the design:

finishes: [
  { id: 'title-foil', process: 'foil', sheen: 'gloss', shape: { element: 'seal' } },
  { id: 'spot-uv', process: 'varnish', shape: { box: { zone: 'front', x: 0, y: 0, width: 150, height: 120 } } },
  { id: 'relief', process: 'emboss', shape: { element: 'publisher' } },
],
  • process: varnish or foil, printed on a spot plate of its own (an ink with a finish); or emboss or deboss, a relief die.
  • ink: the varnish's or foil's spot colour. By default a varnish is Varnish and a foil Gold foil.
  • sheen: gloss (the default), satin, matte or softTouch.
  • shape: what the finish covers: a box of its own ({ box }, placed like an element), the shape of an element, effect or logo ({ element: id }; a picture's contour when its resource has one), or a saved outline in a box of its own ({ outline, box }).

An emboss or a deboss prints nothing. Its shape goes to the printer on a technical plate, next to the die line: a Separation named Emboss or Deboss that the preflight lists and no proof paints. The binder makes the relief die from it.

#A design for each sheet

A hardcover is made of several sheets, and by default all of them take the book's cover design. sheets gives a sheet a design of its own, used in place of the book's on that sheet:

cover: {
  image: { resourceId: 'jacket-art', area: 'sheet' },
  sheets: {
    case: {
      background: { hex: '#1d2a44', model: 'hex' },
      finishes: [{ id: 'spine-foil', process: 'foil', shape: { box: { zone: 'spine', x: 1, y: 20, width: 8, height: 80 } } }],
    },
    endpapers: { background: { hex: '#efe6d2', model: 'hex' } },
    endpaperBack: {
      background: { hex: '#efe6d2', model: 'hex' },
      elements: [{ id: 'series', kind: 'catalogue', zone: 'flyleaf', x: 15, y: 40, width: 120, height: 150, columns: 3 }],
    },
  },
},

The sheets are named:

  • case: the covering of a case, such as a cloth case stamped in foil under a printed jacket.
  • jacket: the dust jacket.
  • endpapers: both endpapers; endpaperFront and endpaperBack: one of them, over endpapers.
  • cover: the cover of a softcover, or the covering of a case that has no case design.

Each is a whole design, with every field of cover except sheets, and it takes nothing from the book's: in the example, the case does not show the jacket's picture. A sheet without a design of its own takes the book's.

#The cover's text

The cover's text is a Markdown document of the book, kept next to its chapters. Each block fills one zone or one text box by its name:

:::frame{slot="back"}
A city that keeps its books underground, and the girl who reads them aloud.
 
:::paragraphs{style="cover-praise"}
"A novel to read in one sitting." — *A newspaper*
:::
:::
 
:::frame{slot="flapFront"}
**Ana Pérez** was born in Zaragoza in 1984. *The Underground Library* is her second novel.
:::
 
:::frame{slot="praise"}
*Winner of the First Novel Prize*
:::

The text is set in the book's typography: its paragraph styles, character styles and fonts. Six paragraph styles are the cover's own, and the book may redefine them: cover-title, cover-subtitle, cover-author and cover-spine, and for the collection's catalogue (below) cover-catalogue and cover-catalogue-current. The front and the spine the Markdown leaves empty take the book's title, subtitle and author from its metadata, set in these styles, on every build: they are never copied into the cover's text. A front or spine frame replaces them with its own text.

A frame for a slot the sheet does not have (a flap on a sheet without flaps, a back cover on an endpaper) is left out, and the check says so; a second frame for one slot is left out too. Write the cover's text as paragraphs and paragraph styles: a # heading takes the design the book gives its chapter headings.

One cover text serves every version and every sheet. A book in several languages may give each language its own.

#A text for one sheet

A frame that names a sheet with sheet is laid out on that sheet only, and there it takes its slot over a frame that names none. A case under a jacket can carry the collection's name alone on its front, while the jacket's front keeps the title from the metadata:

:::frame{slot="front" sheet="case"}
**Library of the Sea**
:::
 
:::frame{slot="flyleaf" sheet="endpapers"}
*From the publisher's archive*
:::

sheet takes the names of cover.sheets, one or several separated by spaces (sheet="case jacket"). A frame for cover also reaches the covering of a case, which answers to both case and cover, while one for case reaches the case alone; one for endpapers reaches both endpapers. An empty frame for one sheet, closed straight away (:::frame{slot="back" sheet="case"} followed by :::), leaves that zone bare on that sheet: it takes the slot from the frame shared by every sheet and puts nothing there. On the front or the spine it also keeps out the title the metadata would set. A name that is no sheet's is reported (coverFrameSheetUnknown), and a frame that names no other sheet is left out.

#The collection's catalogue

::catalogue, on a line of its own inside a frame, sets the titles of production.collection.catalogue in order, a paragraph each: its number, an en space and the title. The titles are set in cover-catalogue, at the body size from the left, and the book's own (collection.volume) in cover-catalogue-current, in bold.

:::frame{slot="flyleaf" sheet="endpaperFront"}
**In the same collection**
 
::catalogue{numbers="I" last=6}
:::
 
:::frame{slot="flyleaf" sheet="endpaperBack"}
::catalogue{numbers="I" first=7}
:::
  • numbers: the counter style of the numbers: 1 (the default), 01, I, i, A, a, or none for titles without numbers.
  • first and last: the first and last titles set, by their place counting from 1, to share a long list between the two endpapers. Each title keeps the number of its place in the whole list.

A book whose collection has no catalogue gets nothing in its place.

#The checks

Building a cover reports what it could not do as asked. The Sandbox shows them in the Cover panel's Checks, the command line prints them, and buildCover returns them in issues:

KindWhat happened
bindingProfileMissingThe version names a binding profile the book does not have.
profileOutOfRangeThe trim or the spine is outside what the profile's accepts allows.
isbnInvalid, coverIsbnInvalidThe ISBN does not read: its length or check digit is wrong. The cover has no barcode.
spineOverriddenThe spine was set by hand; both the calculated and the used widths are given.
signatureBlanksRounding to whole signatures adds blank pages.
spineTooThinForTextThe spine is under minSpine and carries no text. On a hardcover it is the case's spine, two boards wider than the pages, that counts.
coverTextBoxNameA text box has a name the cover cannot use.
coverSlotUnknown, coverSlotRepeatedThe cover's text fills a slot the sheet lacks, or one slot twice.
coverFrameSheetUnknownA frame of the cover's text names a sheet that does not exist (sheet="…").
coverMirrorSkipped, coverMirrorCappedThe mirrored bleed left out pictures it could not read, or stopped short of the sheet's edge.
coverClipSkippedPictures cut to an outline were drawn whole.
coverBarcodeSizeThe barcode was asked under 80 % and is set at 80 %.
coverVersionMissing, coverSheetMissingThe book has no such version, or the version no such sheet.

The configuration checks also read production and cover like any other setting: an unknown key, a value of the wrong kind or an ISBN that does not read is reported with its path. Each design of cover.sheets is read like the cover's own, and so are a sheet name that is not one of the six, a catalogue element's columns, first and last that are not whole numbers from 1, a negative gap, and a collection.volume that names no title of the catalogue.

The cover's PDF goes through the same preflight as the book's: resolution of its pictures, black, ink coverage, its finishes and technical plates.

#In the Sandbox

The Cover panel, in the sidebar, holds the print versions and their cover:

  • Versions: Add paperback or Add hardcover, then each version's name, binding, ISBN, add-on and work ISBN, its flaps or jacket, a case's material, the spine from the printer, the direction of the spine text and the narrowest spine that takes it. This version's measures overrides the profile's for this version only.
  • Sheet: which sheet is shown (cover, jacket, front or back endpaper), and its pages, spine and size.
  • Design on the sheet: Edit on the sheet turns the sheet into the designer. Text boxes, colour boxes, veils, pictures, logos and finishes are added from its bar, dragged and resized on the sheet, snapping to folds, safe areas and each other (Alt turns snapping off). The arrow keys move the selected item 1 mm, 10 mm with Shift. Layers lists the items under the text, the text boxes, the items over the text, the logos and the finishes, and orders them. The selected item's fields set its place, colour, opacity, how a picture fills its box, its corner radius, border, gradient and shadow, what it does past a mirrored bleed, whether it scales with its panel, and its path, outline or clip. Renaming a text box moves its text in the cover's Markdown with it.
  • Texts: one Markdown editor per zone and text box. The front and the spine show what they take from the metadata until they are given own text.
  • Collection: the collection's name and ISBN.
  • Files for the printer: Download sheet PDF, written with the book's PDF settings (colour space, output profile, PDF/X), and Download front cover as a picture.
  • Checks: the checks above.
  • Printer profiles: binding profiles copied from a built-in one and set to a printer's measures, each by millimetres, by a share of the trim or by steps of trim size, with what it comes to for this book; paper profiles with their supplier and commercial name; and Export profiles and Import profiles for the .postext-production.json file.

The designs of single sheets, the texts for one sheet, the catalogue element and the collection's volume are edited in the Cover panel too.

The Design panel's Cover design group holds the grounds, the picture, the zones' text alignment, the barcode size and the mirrored bleed. Every change in the Cover panel is a step of the undo history.

Pictures for a cover often come as print files. The Resources panel reads a PDF, or an Illustrator file saved with PDF compatibility, as one picture per page at 300 ppi on a clear background, and TIFF and PSD files at their full size. An EPS file is not read: the panel asks for it saved as PDF.

#From the command line

postext cover typesets one sheet of a version:

postext cover book.postext -o cover.pdf
postext cover book.postext --print-version hardcover --sheet jacket -o jacket.pdf
postext cover book.postext -o front.jpg --dpi 300

--print-version chooses the version (the first by default), --sheet the sheet (cover, jacket, endpaper-front or endpaper-back). A path ending in .png, .jpg or .webp, or --format, paints one panel instead of the PDF: the front cover unless --zone names another (back, spine, flapFront, flapBack, or sheet for the whole). The PDF options (--color-space, --pdfx, --profile and the rest) apply as for postext pdf. See Command line.

#From code

postext/production holds the whole cover chain. buildCover takes the book's configuration, a version, the laid-out pages (for the spine), the cover's Markdown, the metadata and the resources, and returns the cover as a document of one page:

import { buildDocument } from 'postext';
import { buildCover } from 'postext/production';
import { renderToPdf } from 'postext-pdf';
 
const book = buildDocument(content, config);
const cover = buildCover({
  config,
  version: 'paperback',
  pages: book.pages,
  markdown: coverMarkdown,
  metadata: content.metadata,
  resources: content.resources,
  sheet: 'cover',
});
if (!('config' in cover)) throw new Error(cover.issues.map((i) => i.kind).join(', '));
 
const doc = buildDocument(cover.content, cover.config);
const pdf = await renderToPdf([doc], {
  fontProvider,
  resourceBytes: (fileId) => cover.files[fileId] ?? bookFiles[fileId],
});

cover.sheet gives the sheet's size and zones in mm, cover.sheets every sheet of the version with its spine, and cover.issues the checks. pages may also be a page count, all on the book's paper.

The rest of the module exposes each step:

  • ISBN: parseIsbn reads and checks an ISBN, isbnBarcodeSvg draws its EAN-13 barcode with an add-on, ean13CheckDigit and isbnCaption the rest.
  • Measures and sheets: resolveBindingMeasures works out a profile's measures for a trim, resolveLength one measure, checkProfileAccepts the limits; spineFromRuns, pageRunsOf, signaturePages and leafMm the spine; softcoverSheet, caseSheet, jacketSheet and endpaperSheet each sheet, and versionSheets a version's.
  • The design: coverPage composes a sheet's page template, coverSource the Markdown it is laid out from, coverZoneBox a zone's box, placeCoverElement and coverElementRect an item's place, basicShape, pathData and flattenCoverPath its shapes; coverSheetNames and coverDesignFor the design a sheet takes, and withCatalogue and expandCatalogueText the catalogue's pictures and lines.
  • Profiles and settings: BUILT_IN_BINDING_PROFILES, DEFAULT_BINDING_MEASURES, DEFAULT_SPINE_TEXT, exportProductionProfiles, importProductionProfiles and readProductionConfig, which reads a production block from untrusted data and reports what it dropped.
  • Folio: folioOfBook gives the Folio settings with the first version's binding, and productionFolioBinding and folioVersionOf a chosen version's.

#In a .postext file

A bundle carries the production and cover settings in its configuration and the cover's text as cover.md beside the chapters. A language with a cover text of its own carries it as cover/<language>.md. openBundle (from postext/bundle) returns it as coverMarkdown, and createBundle takes it the same way. See Bundles.

#Folio and EPUB

The Folio view binds the book as its first version: a perfect binding or a sewn softcover as a paperback, a case as a hardcover, with the cover's spine painted on the spine. An EPUB written by the command line or the Sandbox takes the print front cover as its cover picture when the book has a print version and names no other.

#Limits

  • The spine counts pages as laid out. A book whose pages change after the cover is made needs its cover made again; the spine and every panel follow on their own.
  • The default measures are a starting point taken from published specifications. Ask the printer for theirs and keep them in a profile.
  • Only PDF and the picture formats are written. An IDML package of the cover sheet is not.
  • A # heading in the cover's text takes the book's chapter heading design; set cover titles with paragraph styles.