write_image.json
The JSON file of the “Images on a page” example. A photograph that goes in exactly as it came out of the camera, and one with transparent parts that keeps them, each on a page cut to its own size.
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: logo.png, photo.jpg. 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 photograph compressed once and then compressed a second time by whatever put it into the document comes out soft, blotchy at the edges, and heavier than the original was. It is the commonest way a good picture is spoilt between the camera and the printer, and nothing in the finished file admits that it happened.
What this example shows
- A photograph passed through untouched, never squeezed a second time.
- A picture whose transparent parts are still transparent.
- A page cut to the size of the picture, so nothing is scaled.