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.
@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.
{
"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.
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.
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.
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.
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.