PDFPipe

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.

css
@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.

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

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