A sheet that measures what it says

Print anything meant to be measured — a cutting pattern, a plan, a scale drawing — and the print window quietly shrinks it a few per cent to clear the printer's own margins. Nobody sees it happen. The page looks right; the ruler printed on it is simply wrong, and the part somebody cuts to that measurement comes back the wrong size.

This page carries three rulers — sixteen centimetres, inches and printer's points — and two instructions to whatever prints it: put me out at the size I was drawn, and offer that one size. The second only became possible with PDF 2.0, so this file says 2.0 openly: you tell a document which version it announces, and when it carries something that asks for a later one, the library names what asked for it rather than write a file claiming less than it holds. Lay a tape measure on the printed sheet and you can see for yourself whether the printer obeyed.

What this example shows

  • Three rulers — sixteen centimetres, inches and points — drawn to be measured against a real one.
  • A page asking to be printed at its true size, and offering that size only.
  • How hard the content is squeezed, and whether it is written as it goes: both your decision.

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. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.

Read the Rust source Read the Python source Read the JSON source

The document itself

Open the document in English Open the document in French

A sheet that measures what it says, first page

Optimised, this document weighs 15.5 kB — at least 85 % lighter than most PDF generators would write it

The document is lighter than it was, and every page still looks exactly the same. See this document's row in the table of every example.

Examples near this one

A register whose pages say where they came from

Two sittings bound into one file. Each page carries a record of its own — what it is, whose hand wrote it, the day it was written — the photograph on the second page carries one too, and each transcription is tied to the page it transcribes rather than to the file at large.

A file that explains its own entries

A records office's reference, the department it came from, the date until which the document must be kept and its classification, carried inside a file an archive still accepts. No archiving rule knows what a keep-until date is, so each entry carries a description of itself, and that description is what makes a checker accept a fact you alone invented.

A delivery note that knows its own order

Every line of the note carries the order it was picked for, the article code and the shelf it came off, and prints none of them. The place where the driver signs carries the round and the van, and one beside the fold tick carries nothing but its own place.

A document that can be read aloud

Two pages carrying a copy of themselves that nobody sees: this is a heading, this is a table, and this is the order to read them in. Software reading the document aloud follows that instead of the order the marks were drawn in, and skips the running head. On the page, nothing looks any different.

A list whose pictures speak too

A parts list whose first column is a picture rather than a word. Each picture carries the sentence somebody hears in its place, so nothing in the list is lost on a reader who cannot see it. On the page, the pictures are simply pictures.

Every example, by subject