A size of its own for certain pages
Give one named page a width and a height of its own, leaving every other page of the document as it is.
Written at the top level of a request, under
"page_sizes"
In plain words
Written for anybody. It says what this puts on a sheet of paper, and asks nothing of you beyond that.
In a bound folder, one sheet is sometimes larger than the rest: a plan, a wide table of figures. That is exactly what happens here. You name the page by its number, give it a width and a height, and that page alone changes. Every other page keeps the document's common size.
For a developer
Written for somebody who writes the calling program: the model, the units, and the settings that carry the weight.
page_sizes is a list of entries, each naming a page by its one-based number and giving it two dimensions in points. An entry states the size of a page, it does not create one: naming a page past the end of the document leaves the document as long as it already was. A page named twice takes the last size given for 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.
-
page_sizes— array, optional, empty by default. -
page_sizes[].page— integer ≥ 1, required. The page the entry is for. -
page_sizes[].width— number, required. Width in points. -
page_sizes[].height— number, required. Height in points.
An entry overrides page for the one page it names. For a page to exist, an item names it in its pages, or content flows down to it. Every other page keeps the size from page, A4 by default.
A whole request that draws it
Post this as it stands and a PDF comes back. Nothing has been left out of it.
{
"page_sizes": [{ "page": 2, "width": 841.89, "height": 595.28 }],
"standard_fonts": [{ "name": "sans", "face": "helvetica" }],
"items": [
{
"type": "text",
"pages": [1],
"rect": { "llx": 60, "lly": 760, "urx": 535, "ury": 785 },
"content": ["Page one, upright"],
"font": "sans",
"font_size": 14
},
{
"type": "text",
"pages": [2],
"rect": { "llx": 60, "lly": 540, "urx": 780, "ury": 565 },
"content": ["Page two, wider than it is tall"],
"font": "sans",
"font_size": 14
}
]
}
The sheet, and what is laid under it
The size of the pages The areas a page states Which way up a page is shown The headed paper under the pages
Where to go next
Every key of a request, in one page The other thirty-two settings of a request