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.

Summary

In a bound folder, one sheet is sometimes larger than the rest: a plan, a wide table of figures, a map folded into the binding. Here the sheet is named by its number, and as many of them can be named as you like — one plan on page four, another on page eleven, each with a size of its own.

Technically

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

page_sizes is a list of entries, each naming a page by its one-based number and giving it a /MediaBox of two dimensions in points; every other page stays on the document's size. 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.

Request schema

  • 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 creates a PDF

{
  "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 line that sends it, in three languages

The sheet, and what is laid under it

The size of the pages The unit a page is measured in The areas a page states The shapes a page lays over what it draws Which way up a page is shown 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

See the prices See the examples