Everything that can be drawn on a page

The one required key: the list of what gets drawn, in drawing order. Twenty-one kinds in all.

Written at the top level of a request, under "items"

In plain words

Written for anybody. It says what this puts on a sheet of paper, and asks nothing of you beyond that.

Everything else settles the document; this one fills it. It is the list of what appears on the pages: text, a table, a photograph, a barcode, a line, a tick box. Each thing in the list says what it is and where it goes, and they are drawn in the order they are written — the last one passes over the ones before, like sheets stacked on a desk.

For a developer

Written for somebody who writes the calling program: the model, the units, and the settings that carry the weight.

items is the one key a request must carry. It is an array, in drawing order, where each entry carries a type key saying which of the twenty-one kinds it is. Most kinds share a common base of settings: the rectangle they live in, the pages they appear on, the layer they belong to, a rotation or a transform. Each kind has a detail page of its own.

Every key, with its default

The reference: which keys are required, which are optional, what each one defaults to and which combinations the server declines.

  • items — array, required. The one key a request must carry.
  • Each entry is an object carrying type, or an array whose first element is the label. An object with no type is refused; two type keys in one object are refused too.
  • Twenty-one type values, each with a page of its own, listed below.
  • Settings most kinds share: pages (array of integers, empty by default, meaning every page), layer (the name of a declared layer), id and relative_to (placement relative to another item), transform (six numbers) or rotate (degrees) — both together are refused.

The twenty-one things an item can be

Each has a page of its own: what it is, what a developer needs to know about it, every key it takes with its default, and a whole request showing it.

Text

Tables

Pictures and imported pages

Barcodes and square codes

Shapes

Form fields

  • A box the reader types into text_field Add a box to fill in: a name, an address, a comment over several lines, a hidden password, or a number one box per digit.
  • A box the reader ticks check_box Add a tick box: accepting terms, choosing an option, with the mark you pick and the value the form reports.
  • A list the reader picks from choice_field Offer a list of answers: an open list, a drop-down menu, or a menu the reader may also type an answer into.
  • Several buttons, one answer radio_group Place buttons of which only one stays chosen at a time, each in its own spot, all belonging to the same question.
  • The place kept for a signature signature_field Keep a spot on the page where an electronic signature will settle, with its name and its frame.
  • A button the reader presses push_button Place a button that acts instead of answering: open an address, go to a page, send the form or reset it.

Navigation

A whole request that draws it

Post this as it stands and a PDF comes back. Nothing has been left out of it.

{
  "standard_fonts": [{ "name": "sans", "face": "helvetica" }],
  "items": [
    {
      "type": "rect",
      "rect": { "llx": 60, "lly": 700, "urx": 535, "ury": 780 },
      "fill": [0.93, 0.95, 0.98]
    },
    {
      "type": "text",
      "rect": { "llx": 72, "lly": 730, "urx": 523, "ury": 760 },
      "content": ["Drawn second, so it sits on top"],
      "font": "sans",
      "font_size": 16
    }
  ]
}

The line that sends it, in three languages

What is drawn, and how it comes out

The file's weight and the time it takes Sheets a reader shows or hides A drawing made once, shown by a button

Where to go next

Every key of a request, in one page The other thirty-two settings of a request

See the prices See the examples

Glossary

barcode
Black bars and white gaps of different widths, standing for a number a scanner reads back in one pass. The bars carry the number and nothing else: the price, the article and the delivery are looked up from it. A code fetched as a picture and then resized, or trimmed too close, stops being read at all.
request
One call to the service: you send what the document should say, and get the document back. Your bill counts these calls, one for each document. The number of pages inside a document is never counted.
layer
A named group of things drawn on a page that a reader can switch on and off, like tracing paper laid over a plan. A drawing can hold its measurements on one and its notes on another, and a layer can be set to show on screen and stay off the printer.

Every word the site explains