write_overlay.json
The JSON file of the “An invoice laid on a letterhead template” example. An invoice laid over a letterhead supplied as a PDF file.
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: letterhead. 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
Every customer has their own letterhead, and not one of them will send you the fonts, the logo file and the exact colour it was printed in. What they will send is a PDF of it. Rebuilding that letterhead by hand means it comes out nearly right — on every document you produce for them, for as long as they are a customer.
What this example shows
- A template read once and reused as it stands.
- Its fonts and colours carried over untouched.
- New content composed on top of the page it lays down.