Toolbox
The Toolbox web service provides various PDF operations that can be executed on existing PDF documents. These include, for example, functions for rotating pages, merging or splitting PDF documents and exporting PDF documents into other formats.
| HTTP REST-API | OpenAPI |
|---|---|
POST /toolbox/{documentId} | 🔗 |
The selection of the PDF operations to be executed is made via the parameters of the web service call. In the parameters, an array is defined for the toolbox parameter, which contains the operation. Each entry in the array describes the operation to be executed, with its respective parameters. The possible operations are defined in the API documentation under toolbox.
You can perform several operations in one call with the Toolbox web service if you set multiple entries in the toolbox array in the parameters.
The operations of a call are chained: each operation works on the result of the operation before it. This only works as long as that result is a PDF document. An operation that returns something else — an image, an archive, an HTML page or an extracted data file — therefore ends the chain, and any operation following it is answered with the error INVALID_SOURCE_FORMAT = -18. Place such an operation last, or split the work into separate calls.
The Toolbox web service works on a single PDF document. Passing a ZIP archive that holds several documents is only provided for the merge operation, through its sourceIsZip parameter. Any other operation that produces a result file of its own answers such a source with the error TOOLBOX_MULTIPLE_SOURCE_DOCUMENTS_NOT_SUPPORTED = -501. To process the contents of an archive, extract it first (see Archives) and call the web service for each document. An archive that contains no document at all is refused as well, with INVALID_SOURCE_FORMAT.
Example of the rotate function
{
"toolbox": [
{
"rotate": {
"degrees": 90,
"orientationDetectMode": "value",
"pageGroup": "all",
"pageOrientation": "any",
"pages": "1"
}
}
]
}