Label sheets / A4 sheet, 21 labels
21-per-sheet A4 label PDF template
Twenty-one 63.5 by 38.1 millimetre labels in a 3 by 7 grid on A4, which is the standard European address label sheet.
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: 210 x 297 mm
- Inches: 8.27 x 11.69 in
- Points: 595 x 842 pt
- CSS pixels: 794 x 1123 px at 96 dpi
Where the size comes from
It is the metric counterpart to the North American 30-up sheet and the geometry is just as fixed: 15.15mm clear at the top and bottom, 7.25mm at each side, three columns of 63.5mm with 2.5mm gaps, and seven rows of 38.1mm with no gap at all. The 38.1mm row is exactly 1.5 inches, which is a reminder that the die predates the metric labelling on the box.
What gets printed at this size
- address labels for European postal mail
- file, shelf and archive box labels
- batch product labels on office equipment
Margins that survive a real printer
15.15mm top and bottom, 7.25mm left and right, and those numbers are not adjustable. Within a label, 2mm of padding is the practical minimum. A four line address at 8pt fits 38.1mm with very little to spare, so set the line height rather than inheriting it.
The CSS
A4 sheet, 21 labels 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: A4;
margin: 15.15mm 7.25mm;
}
.sheet {
display: grid;
grid-template-columns: repeat(3, 63.5mm);
column-gap: 2.5mm;
grid-auto-rows: 38.1mm;
}
.label {
padding: 2mm 3mm;
overflow: hidden;
font-size: 8pt;
line-height: 1.2;
}The render request
With a named format the size travels in the options and the CSS is optional.
{
"html": "<!doctype html>...",
"options": {
"format": "A4",
"margin": { "top": "18mm", "bottom": "18mm", "left": "16mm", "right": "16mm" }
}
}The mistake people make
Assuming a 21-up A4 sheet and a 30-up Letter sheet are interchangeable because both hold addresses. The labels are different sizes on different pitches, so a template built for one prints across the die cuts on the other and every label is ruined.
Frequently asked
What is A4 sheet, 21 labels in pixels?
794 x 1123 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 210 x 297 mm instead, because a page laid out in pixels shifts whenever the render scale changes.
Can I pass A4 sheet, 21 labels as a format?
Yes. "A4" 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.
30-per-sheet address label PDF template
Thirty 2.625 by 1 inch labels in a 3 by 10 grid on a Letter sheet, which is the most common laser address label stock in North America.
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.
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.
Business card PDF size and bleed
85.6 by 53.98 millimetres is the ID-1 rectangle: the size of a bank card, and the business card standard across most of the world.
DL envelope PDF size and window position
DL is 220 by 110 millimetres, the standard business envelope in Europe, and it takes an A4 sheet folded in three.
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.