The file's weight and the time it takes
Set how hard the document compresses: the fastest, the smallest, or a file readable in a plain text editor.
Written at the top level of a request, under
"compression"
In plain words
Written for anybody. It says what this puts on a sheet of paper, and asks nothing of you beyond that.
When you pack clothes into a suitcase, you can fold them quickly or press them down at length. The result fits in the same bag, but not in the same space and not in the same time. The document behaves the same way: you choose between going fast and coming out small. There is also a mode that presses nothing at all, handy when you want to open the file and read what is inside with a plain text editor.
For a developer
Written for somebody who writes the calling program: the model, the units, and the settings that carry the weight.
compression sets how hard the document's streams are compressed. Three settings exist: whether to compress at all, the level from 1 to 9, and the gathering of non-stream objects into compressed streams. That last one cuts a document rich in small objects down markedly, and asks for a reader that knows PDF 1.5; it stays off by default, so a file meant for an older reader comes out as it is.
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.
-
compression— object, optional, absent by default. -
compression.enabled— boolean, optional,trueby default. A request naming the block and saying nothing about it compresses all the same, as every document does. Set tofalse, the file opens in a text editor. -
compression.level— integer, optional, from 1 to 9. 1 is the fastest and leaves the most behind, 9 the smallest and the slowest. Absent, the engine keeps its own level. A number outside 1 to 9 is refused, and the answer names it. -
compression.object_streams— boolean, optional,falseby default. Gathers the objects that are not streams themselves into compressed streams, and writes the cross-reference table the same way. Wants PDF 1.5 at least.
A whole request that draws it
Post this as it stands and a PDF comes back. Nothing has been left out of it.
{
"compression": { "level": 9, "object_streams": true },
"standard_fonts": [{ "name": "sans", "face": "helvetica" }],
"items": [
{
"type": "text",
"rect": { "llx": 60, "lly": 740, "urx": 535, "ury": 762 },
"content": ["Packed as small as it goes"],
"font": "sans",
"font_size": 14
}
]
}
What is drawn, and how it comes out
Everything that can be drawn on a page Sheets a reader shows or hides A drawing made once, shown by a button
Where to go next
Every key of a request, in one page The other thirty-two settings of a request
Glossary
- 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.