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.
Send a document to somebody who does not have your house font and one of two things happens: their reading software quietly puts another one in its place and your layout moves, or it draws empty boxes where the letters were. Carrying the font inside the file is the only cure, and it is the first thing a commercial printer will ask you for before accepting the job.
Carrying the whole font would be wasteful — it has thousands of shapes in it and a letter uses a few dozen — so the file takes only the ones it draws. That is the easy half. The hard half is that the words have to come back out: select a sentence in the finished document, copy it, search it, or have it read aloud, and it must still be words rather than a picture of words. The file therefore carries a small list saying which letter each drawn shape stands for, and the team pulls the text back out of the published file to make sure it does. Under the invoice, four more lines set the same font differently: letters spaced one and a half points apart, letters narrowed to four-fifths of their width, and lines that step down by a set spacing rather than by a position given for each.
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
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 page for each paper size the library names, from A0 down to A6 and the American sizes, each giving its size in millimetres and inches; then pages laid on their side or upside down, and a banner ten metres long.
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.