The clickable contents down the side
Give the document a folding contents list beside the pages, each line leading straight to a page.
Written at the top level of a request, under
"bookmarks"
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 thick binder, dividers with tabs let you find a section without leafing through. That is exactly what gets built here: a list shown down the side of the document, each line carrying a title and leading straight to the right page. Lines can hold further lines, like a book's contents with its chapters and sub-chapters, and you decide which ones open of their own accord.
For a developer
Written for somebody who writes the calling program: the model, the units, and the settings that carry the weight.
bookmarks carries the tree of bookmarks a reader shows in its side panel. Each bookmark has a title, the page it leads to, and possibly further bookmarks nested under it. The array's order is the display order. For the panel to open by itself when the document opens, ask for it through reading.open_mode. A bookmark leading to a page the document does not have is refused.
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.
-
bookmarks— array, optional, empty by default. -
bookmarks[].title— string, required. What the reader shows for it. -
bookmarks[].page— integer ≥ 1, required. The page the bookmark leads to. A page the document does not have is refused, and the answer names it in the numbering the request used. -
bookmarks[].open— boolean, optional,falseby default. Shows what is nested under it without being asked. -
bookmarks[].children— array, optional, empty by default. The bookmarks nested under this one, same shape, to any depth.
A bookmark leads to a page by its number. For a landing place that follows the document rather than the number, go through destinations and a link item that names it.
A whole request that draws it
Post this as it stands and a PDF comes back. Nothing has been left out of it.
{
"bookmarks": [
{
"title": "Contents",
"page": 1,
"open": true,
"children": [{ "title": "The annex", "page": 2 }]
}
],
"standard_fonts": [{ "name": "sans", "face": "helvetica" }],
"items": [
{
"type": "text",
"pages": [1],
"rect": { "llx": 60, "lly": 740, "urx": 535, "ury": 768 },
"content": ["Contents"],
"font": "sans",
"font_size": 18
},
{
"type": "text",
"pages": [2],
"rect": { "llx": 60, "lly": 740, "urx": 535, "ury": 768 },
"content": ["The annex"],
"font": "sans",
"font_size": 18
}
]
}
Finding one's way through it
The order one field leads to the next Landing places that carry a name Following an article column by column How the document opens and prints
Where to go next
Every key of a request, in one page The other thirty-two settings of a request
Glossary
- bookmark
- The list of headings a PDF reader shows down the side of a document, each line leading straight to its place in it. It is the table of contents the software owns rather than the one printed on a page, and a long document without it is one nobody can find their way around.
- 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.