Every Paper Size, on Its Own Page

A poster, a letter for an American customer, a postcard: each needs its own page size, and a program should not have to look up how many points an A3 sheet measures. The library knows the usual sizes by name. Here each one gets a page of its own, from the A0 poster down to the A6 card, then B4, B5, Letter, Legal, Tabloid and Ledger, and each page states its size in millimetres and in inches inside a frame drawn a centimetre in from its edge.

The pages after them show what else a page can ask of the reader that opens it: an A5 laid on its side, pages to be shown upside down or turned a quarter to the left, and pages that say in which order the Tab key moves through them. The last page is a banner ten metres long: a PDF page cannot normally be that big, so this one states that each of its units stands for ten points instead of one.

What This Example Shows

  • Every size the library names, each on a page of its own.
  • Pages laid on their side or upside down for the reader.
  • A page ten metres long.

The Source Code, Complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library.

Read the Rust source Read the Python source

The Document Itself

Open the document in English Open the document in French Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese

Every Paper Size, on Its Own Page, first page

The Same Document in Other Languages

This document weighs 20.1 kB

Examples Near This One

A Minimal PDF

Two identical pages that draw the structure of an invoice with lines and rectangles, without a word of text: the file is about a dozen kilobytes and embeds no font.

Showing Page One Before the File Has Arrived

The same document written twice: once as it is, once with its first page placed at the start of the file. The page gives, for each of the two, the number of bytes a browser must have received before it shows page 1.

Fonts Embedded in the File

Text set in a font embedded in the file, cut down to the letters actually used, and still searchable, copyable and readable aloud.

Every example, by subject