A page of a supplied PDF, placed on the page

Take one page of a PDF sent with the request and place it in a frame, at its own proportions, among the other items.

Asked for with "type": "pdf_page"

In plain words

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

You already have a document as a PDF: a warranty slip, a plan, a receipt. Rather than making it again, you send it as it is and ask for one of its pages to settle inside a frame on your new sheet. The page keeps its shape: it grows until it meets the nearest edge and centres in what is left, unsquashed. Around it you carry on writing, drawing and placing tables as usual.

For a developer

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

The source PDF's bytes travel with the request, in a named part; the pdf key repeats that name, from the same pool the templates come from, so one supplied file serves both as a page background and as a placed item. The page number counts from 1. The imported page keeps its proportions: it is scaled until it meets the frame's width or height, then centred in the rest. Unlike a template, which lines the whole page under the content, this item is one element among the others, placed in a box, and so combines with text beside it.

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.

Required keys: pdf, a string naming the supplied part; rect. Optional: page, a one-based integer, default 1; pages, an array of one-based integers, default empty for every page of the produced document; transform, six numbers; rotate, degrees counter-clockwise about the centre of the box; layer, the name of a declared layer. Cross refusal: transform together with rotate. The imported page always keeps its proportions: the images' fit key has no counterpart here.

A whole request that draws it

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

{
  "items": [
    {
      "type": "pdf_page",
      "pdf": "receipt.pdf",
      "page": 1,
      "rect": {"llx": 72, "lly": 480, "urx": 523, "ury": 780}
    }
  ]
}

The line that sends it, in three languages

Pictures and imported pages

A picture placed in a rectangle

Where to go next

Every key of a request, in one page The other twenty things you can draw

See the prices See the examples

Glossary

byte
The unit a file's weight is counted in, the way a parcel is counted in grams. A thousand of them make a kilobyte, and a million make a megabyte — the size of one photograph taken with a telephone. A one-page PDF here weighs between six thousand and a hundred and twenty thousand, so a hundred of them fit in the space of five photographs.
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.
template
A PDF file made once and reused as the background of new pages: your letterhead, a plain sheet for the pages that follow, the page of terms you always attach at the end. The file is laid down exactly as it stands, to the millimetre, and the new text is written on top.
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