Which way up a page is shown
Turn a page a quarter turn before reading software shows it, without moving anything drawn on the sheet.
Summary
In a report, a wide table sits better lying down than standing up. It is the gesture you make with a sheet of paper, turning it in your hands to read what is written sideways: what is drawn stays put, the sheet is what turns.
Technically
Written at the top level of a request, under
"page_turns"
page_turns writes /Rotate on the pages it names — 90, 180 or 270 degrees clockwise — which is the rotation reading software applies before showing the sheet. The content is not moved: the sheet turns. That is how a landscape page lives inside a portrait document. An upright page writes no /Rotate at all. It is a different thing from an item's rotate, which turns what is drawn on a sheet that stays where it is.
Request schema
-
page_turns— array, optional, empty by default. -
page_turns[].page— integer ≥ 1, required. The page the entry is for. -
page_turns[].turn— string, required. Four values:upright(shown as it was drawn),right(a quarter turn clockwise),upside_down(a half turn),left(a quarter turn anticlockwise).
An entry says how a page is shown, not that there is one: a page named past the end of the document leaves the document as long as it already was. A page named twice takes the last turn given for it.
A whole request that creates a PDF
{
"page_turns": [{ "page": 1, "turn": "right" }],
"standard_fonts": [{ "name": "sans", "face": "helvetica" }],
"items": [
{
"type": "text",
"rect": { "llx": 60, "lly": 740, "urx": 535, "ury": 765 },
"content": ["Drawn upright, shown on its side"],
"font": "sans",
"font_size": 14
}
]
}
The sheet, and what is laid under it
The size of the pages A size of its own for certain pages The unit a page is measured in The areas a page states The shapes a page lays over what it draws How a page arrives, and how long it stands How far a supplied PDF is allowed to unpack The template under the pages
Where to go next
Every JSON key of a request, in one page The other forty-one settings of a request