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.
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.
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
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
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.
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.
One document written twice: once uncompressed, once compressed. The page gives both file sizes and what the compression saved.
A page that opens without a password and prints like any other, but asks the reading software to forbid copying and pasting its text. The text is encrypted in the file: a program reading it byte by byte finds no sentence in it.
A page nothing shows until its password is typed in: no first line, no preview, no picture of it anywhere. The password is given on the example's page, to be tried.
Text set in a font embedded in the file, cut down to the letters actually used, and still searchable, copyable and readable aloud.