A handbook that says how it wants to be read
You send out a hundred-page handbook. The person who opens it lands on the cover, half magnified, with no list of chapters in sight — and now somebody has to be told where to click. A PDF can say for itself how it wants to be opened: on this page, at this size, with the list of chapters already unfolded down the side. It is a wish and not an order. Desktop reading software such as Adobe Acrobat Reader follows most of it; the reading software built into a browser follows little of it, and each browser draws its own line. Open the document below in both, one after the other, and the difference takes five seconds to see.
Page three of it prints the whole list of what it asks for, so you can compare that list with what your own reading software actually did. It asks to open on the contents rather than the cover, so nobody starts on a title page they did not come for. It asks to fill the window with what is drawn rather than with the paper around it, so the words are readable without touching anything. It asks for the pages two at a time with the cover on its own, the way a book falls open. And it says what the print dialog should come up with — which pages, both sides, how many copies — so whoever prints it stops setting the same four settings every time. On a handbook, a catalogue or a price list that has to open the same way for everybody, that is the difference between a file and a document.
What this example shows
- The page it opens on, how much of the window it fills, and the list of chapters beside it.
- Two pages at a time, with the cover standing on its own.
- A print dialog that comes up already filled in, and the whole list printed on page three to check it against.
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