write_gradient_fill.json
The JSON file of the “Text and shapes filled with a gradient” example. A gradient used as the colour something is filled with: a headline whose letters are windows onto a blend of three colours, and a panel filled with a circular one.
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.
What this example is for
A headline in a blend of colours belongs to a poster, a cover, a title page — and the usual way to get one is to build it in a drawing program and drop the picture in. The text then stops being text: it cannot be searched, it cannot be copied, and it cannot be translated without going back to whoever made it.
What this example shows
- A gradient used as a fill colour rather than painted directly.
- Text whose glyphs show the gradient behind them.
- The gradient pinned to the page, so it spans the whole word.