Everything that can be drawn on a page

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

Summary

Everything else settles the document; this one fills it. Text, a table, a photograph, a barcode, a line, a tick box: each thing says what it is and where it goes. The last one written passes over the ones before, like sheets stacked on a desk, which is how a stamp ends up on top of the page it crosses.

Technically

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

items is the one key a request must carry. It is an array, in drawing order, where each entry has a type key saying which of the twenty-four kinds it is; that order is paint order, so a later item covers an earlier one. 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.

Request schema

  • 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-four type values, each with a page of its own, listed below.
  • Settings most kinds share: pages, either an array of one-based integers, empty by default and meaning every page, or a rule: every, one of page (the default), odd_page or even_page; from and to, one-based page numbers, each included, absent running from the first page and to the last; but, an array of pages left out, each a number or an expression, so "{page_of_headline}" leaves out the page an item opened on. 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-four things an item can be

Each has a page of its own: what it is, what it does technically, the schema of the request it takes, and a whole request showing it.

Text

Tables

Pictures and imported pages

Barcodes and square codes

Shapes

Form fields

  • A field the reader types into text_field Add a field to fill in: a name, an address, a comment over several lines, a hidden password, or a number one square 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 creates a PDF

{
  "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",
      "id": "headline",
      "rect": { "llx": 72, "lly": 730, "urx": 523, "ury": 760 },
      "content": ["Drawn second, so it sits on top"],
      "font": "sans",
      "font_size": 16
    },
    {
      "type": "text",
      "rect": { "llx": 72, "lly": 690, "urx": 523, "ury": 712 },
      "relative_to": { "id": "headline", "edge": "bottom", "offset": -18 },
      "content": ["Placed under the line above, wherever that one landed"],
      "font": "sans",
      "font_size": 11
    },
    {
      "type": "text",
      "rect": { "llx": 72, "lly": 60, "urx": 523, "ury": 76 },
      "pages": { "every": "even_page", "from": 3, "but": [7] },
      "content": ["On the even pages from page three, page seven excepted"],
      "font": "sans",
      "font_size": 9
    }
  ]
}

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 The first page, shown while the rest arrives Layers reading software shows or hides A name that stands for several layers at once A drawing made once, shown by a button The sets of layers reading software offers Layers reading software shows one of at a time

Where to go next

Every JSON key of a request, in one page The other forty-one settings of a request

See the prices See the examples