write_tiff.json
The JSON file of the “Every picture a scanner put in one file” example. A file of three sheets and a file holding one photograph, each picture on a page cut to its own size; the photograph goes in exactly as the camera wrote it, since reading software reads a photograph itself.
This file is a request: an application sends it over the network to the server, which creates the PDF and sends it back. It makes the same page as the Rust and Python versions of this example. A request names every file it uses, never its content; the call carries the request and the files together. A font the server already holds, such as DejaVuSans, is named with nothing attached. Send the request to the address the API page gives.
This request names files it does not carry: pages.tif#1, pages.tif#2, pages.tif#3, photograph.tif. Each one travels beside the request, in the same call, as a supplied part named exactly as the request names it here — the description says which name plays which role, so you name your files as you like. A request naming a file the call carries nothing of is refused.
What this example is for
A scanner does not give you one file per sheet. It gives you one file with the whole batch inside, and the same is true of a fax machine: every page of the call is in there, one after another. Software that only looks at the first one quietly loses the rest, and nobody notices until the day somebody needs page four.
What this example shows
- Every picture in the file, not just the first one.
- Each one on a page cut to its own size.
- A photograph inside the file is copied across untouched, so it comes out as sharp as it went in.