PDFPipe

ISO A series / A5

A5 page size for PDF generation

A5 is half an A4 sheet, and the right size for a document that is short enough that A4 looks empty.

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: 148 x 210 mm
  • Inches: 5.83 x 8.27 in
  • Points: 420 x 595 pt
  • CSS pixels: 559 x 794 px at 96 dpi

Where the size comes from

A5 is A4 folded across its long side. Two A5 pages impose onto one A4 sheet with no scaling and no waste, which is why booklets, order pads and event programmes settled on it: the printing is done on A4 stock and cut.

What gets printed at this size

  • booklets and programmes, imposed two-up on A4
  • compliment slips, order confirmations and short letters
  • flyers and inserts that ship inside a C5 envelope unfolded
  • receipts in markets where thermal rolls are not used

Margins that survive a real printer

12mm all round. A5 has roughly half the area of A4, so an 18mm margin that looked generous on A4 eats a visibly larger share of the page here. Scale the body text down with it: 11pt on A4 is closer to 9.5pt on A5 for the same feel.

The CSS

A5 is one of the six named formats the render API accepts, so it can be set in the request options or in the document's own CSS. Setting it in CSS keeps the size with the template, which is usually what you want.

css
@page {
  size: A5 portrait;
  margin: 12mm;
}

body {
  /* A5 is a smaller canvas, not a scaled one. Type set for A4 looks
     oversized here. */
  font-size: 9.5pt;
  line-height: 1.45;
}

The render request

With a named format the size travels in the options and the CSS is optional.

json
{
  "html": "<!doctype html>...",
  "options": {
    "format": "A5",
    "margin": { "top": "18mm", "bottom": "18mm", "left": "16mm", "right": "16mm" }
  }
}

The mistake people make

Rendering at A4 and scaling the output to 71 percent afterwards. That shrinks the type below what was designed and leaves hairlines that were 0.5pt at 0.35pt, which some printers drop entirely. Set the page size, do not scale the page.

Frequently asked

What is A5 in pixels?

559 x 794 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 148 x 210 mm instead, because a page laid out in pixels shifts whenever the render scale changes.

Can I pass A5 as a format?

Yes. "A5" is one of the six format values the API accepts, alongside A4, A3, A5, Letter, Legal and Tabloid.

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.