PDFPipe

ISO A series / B5 (ISO)

B5 page size for PDF generation

ISO B5 sits between A5 and A4, and it is the standard book block size across much of Europe and Asia.

The dimensions

One measurement in four units. Millimetres and inches are what a printer works in; points are what the PDF itself stores; pixels are only useful for checking a screen mock-up against the real thing.

  • Millimetres: 176 x 250 mm
  • Inches: 6.93 x 9.84 in
  • Points: 499 x 709 pt
  • CSS pixels: 665 x 945 px at 96 dpi

Where the size comes from

The B series was defined to fill the gaps in the A series: each B size is the geometric mean of the A size with the same number and the one above it. B5 therefore falls between A5 and A4, which is exactly the range academic and trade books settled into. Note that JIS B5 used in Japan is 182 by 257mm and is a different sheet, so a document set for one will not fit the other.

What gets printed at this size

  • book interiors and academic theses
  • conference proceedings and journal reprints
  • manuals that need more room than A5 without the bulk of A4

Margins that survive a real printer

Asymmetric, because this size is almost always bound. Inner 22mm, outer 16mm, top 18mm, bottom 20mm. The inner margin absorbs the binding, and the extra millimetres at the bottom stop the text block from looking like it is sliding off the page, which is a real optical effect and the reason typographers have set text blocks high on the page for centuries.

The CSS

B5 (ISO) is not one of the six named formats the API accepts, so the size has to come from the document. Declare it in the page box and set prefer_css_page_size in the request.

css
@page {
  size: 176mm 250mm;
  margin: 18mm 16mm 20mm 22mm;
}

/* Bound pages alternate which side the binding is on. */
@page :left {
  margin-left: 16mm;
  margin-right: 22mm;
}

The render request

With a custom size the options carry no format at all: the one flag tells the renderer to use the page box the document declares.

json
{
  "html": "<!doctype html>...",
  "options": {
    // No named format. The page box in the document's own CSS is the
    // size, and this flag is what tells the renderer to use it.
    "prefer_css_page_size": true
  }
}

The mistake people make

Confusing ISO B5 with JIS B5. They are six millimetres apart in width and seven in height, which is enough that a cover printed to one and a block printed to the other will not align.

Frequently asked

What is B5 (ISO) in pixels?

665 x 945 px at 96 dpi, at the 96 pixels to the inch that CSS assumes. That number is useful for comparing a screen mock-up against the page, and useless for laying out the document: use 176 x 250 mm instead, because a page laid out in pixels shifts whenever the render scale changes.

Can I pass B5 (ISO) as a format?

No. The API accepts six named formats: A4, A3, A5, Letter, Legal and Tabloid. B5 (ISO) is reached through the document's page box with prefer_css_page_size set, which is a supported path and not a workaround.

Does landscape need a different page size?

No. Landscape is the same rectangle turned, so it is set as an orientation rather than as swapped dimensions. Writing the width and height the other way round produces the same page and makes the intent harder to read later.

Other page sizes

Sizes that come up in the same conversation, and one from each of the other families.

Paste the CSS below into the playground and see the page box it produces.