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.
@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.
{
"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.
A4 page size for PDF generation
A4 is the default page for business documents everywhere except North America, and the default this API uses when no format is given.
A3 page size for PDF generation
A3 is two A4 sheets side by side, and it is what a document becomes when a table stops fitting.
A6 page size for PDF generation
A6 is postcard size, a quarter of an A4 sheet, and the smallest ISO size that still holds a paragraph comfortably.
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.
US Letter page size for PDF generation
Letter is 8.5 by 11 inches and it is the default page in the United States, Canada, Mexico, Chile and the Philippines.
4x6 shipping label PDF size
The 4 by 6 inch label is the standard thermal shipping label accepted by every major carrier, and the most common non-paper page size an API renders.
80mm thermal receipt PDF size
The 80mm roll is the standard point-of-sale receipt: 80 millimetres of paper, a printable width of about 72mm, and a length that depends on the order.
Every page size, with dimensions
The full list, grouped by what the size is for.
Paste the CSS below into the playground and see the page box it produces.