A sheet that measures what it says
Three rules — centimetres, inches and points — on a page that states it must print at exactly the size it was drawn, and that the reader is to offer nothing else. That second request only exists from PDF 2.0 on, so the file declares 2.0 rather than changing version without you knowing.
A drawing printed to be measured is worth nothing if the printer shrinks it to fit its own margins. This page carries three rules — centimetres, inches and points — and states in the file itself that it must print at exactly the size it was drawn, and that the reader is to offer nothing else.
That second request only exists from PDF 2.0 on, so the file declares 2.0. Nothing is raised on your behalf, and a file asking for it while declaring an older version is refused rather than written. The example also shows the two other decisions that cover a whole file: how hard its content is squeezed, and writing straight to disk as it goes instead of building the whole document in memory.
What this example shows
- A page that asks to be printed at its true size.
- Rules in three units, drawn to be measured with a ruler.
- Compression of the content, and writing as it goes: both your decision.
The code, in full
The same document is written twice, once in each language. Both files are shown in full, with the code coloured on the server, and can be copied in one click.
The document itself
The same document is written in each of these languages. Open the one you want to look at.
Open the document in English
Open the document in French
Read the Rust source
Read the Python source