A Watermark Laid across a Run of Pages
Hand the document one line — SPECIMEN, COPY, CONFIDENTIAL — and let it lay the line across the pages you name, over or under what they say.
See It in a Real PDF
What a document says about itself — DRAFT, COPY, PAID — laid across rectangles of four different shapes and scaled to each, then SPECIMEN given to the document once and laid on every even page.
Summary
A word such as SPECIMEN or CONFIDENTIAL often has to cross every page, or every other page, of a document whose length nobody knows in advance. Here you give the word once, with the pages it covers, and the document lays it on each of them itself, centred and on the slant. You say whether it lies over the text or under it, and whether it keeps one size on every page or grows to fill each one.
Technically
Written at the top level of a request, under
"watermarks"
Each watermark is one line of text drawn on every page of its run, centred on the part of the page reading software shows — its crop box, or else the sheet — and turned across that part the way its slant names. It is drawn inside a run marked as a watermark, so software reading the page aloud leaves it out. from_page and to_page bound the run, the last page following wherever the document ends; parity keeps every page of it, the odd ones or the even ones. Without a size, the line is fitted to each page the way a stamp item fits its box; with one, it is set at that size on every page. stacking draws it after the page's own content, covering what it crosses, or before it, so that whatever the page paints hides it.
Request Schema
-
watermarks— array, optional, empty by default. -
watermarks[].content— string, required. The line the watermark reads. -
watermarks[].font— string, required. The name of the declared font the line is set in. -
watermarks[].from_page— integer ≥ 1, optional. The first page it covers; absent, the first page. -
watermarks[].to_page— integer ≥ 1, optional. The last page it covers; absent, the last page, whatever that turns out to be. -
watermarks[].parity— string, optional,everyby default. Which pages of the run it keeps:every,odd(one, three, five…) oreven(two, four, six…). -
watermarks[].stacking— string, optional,overby default.overdraws it after the page's own content, so that it covers what it crosses;underdraws it before, so that whatever the page paints hides it. -
watermarks[].size— number, optional. The size the line is set in, in points, the same on every page. Absent, it is fitted to each page. -
watermarks[].span— number, optional, 0.95 by default. The share of the page the line is scaled to fill when it has no size of its own. -
watermarks[].slant— string, optional,upby default. Which way the line runs across the page:up,downorflat, as on astampitem. -
watermarks[].color— colour, optional, black by default. -
watermarks[].shadow— object, optional. A copy of the line drawn behind it:dx,dyandcolor, all three required. -
watermarks[].graphics_state— string, optional. The name of a declared graphics state the line is drawn under, for its opacity or its blend mode.
A page outside every run carries no watermark. A stamp item lays a line on the pages it names, at the size its box gives; a watermark is handed to the document once, and every page of its run gets it.
A Whole Request That Creates a PDF
{
"standard_fonts": [{ "name": "sans", "face": "helvetica_bold" }],
"graphics_states": [{ "name": "faint", "state": { "fill_alpha": 0.25 } }],
"watermarks": [
{
"content": "SPECIMEN",
"font": "sans",
"from_page": 2,
"parity": "even",
"stacking": "over",
"size": 96,
"color": [0.75, 0.16, 0.16],
"graphics_state": "faint"
}
],
"items": [
{
"type": "text",
"rect": { "llx": 60, "lly": 740, "urx": 535, "ury": 765 },
"content": ["Page one carries no watermark"],
"font": "sans",
"font_size": 14,
"pages": [1]
},
{
"type": "text",
"rect": { "llx": 60, "lly": 740, "urx": 535, "ury": 765 },
"content": ["Page two is even, and carries it"],
"font": "sans",
"font_size": 14,
"pages": [2]
}
]
}
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 Where a Page's Sheet Sits in the Drawing 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 A PDF You Send, as the Pages Themselves How Far a Supplied PDF Is Allowed to Unpack The Template under the Pages Named Regions a Page Marks for Filling
Where to Go Next
Every JSON key of a request, in one page The other forty-one settings of a request