PDF Watermark
Lays a visible watermark over the pages of a PDF: text, a logo or both, tiled, centred or in a corner.#
/lmkit/v1/pdf-watermarkMarks every page of a PDF, or the zero-based 'pages' named, with 'watermark': a line of text, a logo (its transparency kept) or both, tiled on a diagonal lattice, centred along the page's diagonal or in a corner, at an opacity, size and angle, legible on light and dark content alike. The mark is vector artwork drawn once and referenced by every copy, laid above the page content: it stays sharp at any zoom, adds a few kilobytes to the file, and leaves the page's own text selectable and searchable (the mark adds no text). It reads upright on turned pages and inside cropped ones. Every copy is tagged as a watermark artifact, so marking a document again replaces the mark ('replace_existing', default true) and POST /lmkit/v1/pdf-remove-watermark takes it off. The document is stored on the server and returned as a 'file_id'. No AI model is involved. A signed document is refused with 422 'signed_document' unless 'allow_signature_invalidation' consents to the rewrite that invalidates its signatures; a document declaring PDF/A-1, which forbids transparency, with 422 'pdfa_forbids_transparency' (convert it to PDF/A-2 with POST /lmkit/v1/pdf-to-pdfa first); watermark text holding a character no font on the server draws with 422 'unsupported_characters', naming it. Other unreadable inputs answer 422 with 'password_required', 'invalid_format', 'unsupported_security' or 'page_error'. If processing exceeds the configured timeout, returns 202 Accepted with a job_id to poll at GET /lmkit/v1/jobs/.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
watermarkrequired | The visible watermark laid over each page as vector artwork, above the content. | |
replace_existing | boolean | Whether a watermark this server laid earlier is removed from each page before the new one is laid, so marking a document twice replaces the mark instead of stacking a second one. Default: true. |
inputrequired | string | The source PDF document. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint. |
input_format | How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded PDF file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'. | |
pages | object (int32)[] | Zero-based indices of the pages to process. Omit for every page; an index past the last page is refused with 400. |
allow_signature_invalidation | boolean | Consent to rewriting a digitally signed document, which invalidates every signature it carries. Without it a signed input is refused with 422 'signed_document'. Default: false. |
password | string | Password used to open the source document when it is encrypted. The output is always written unencrypted. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 422 | Unprocessable Entity |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/pdf-watermark" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"watermark": {
"text": "string",
"logo": "string",
"logo_file_id": "string",
"font": "string"
},
"replace_existing": true,
"input": "",
"input_format": "Base64EncodedFile",
"pages": [
"string"
],
"allow_signature_invalidation": false
}'Removes the watermarks laid over the pages of a PDF.#
/lmkit/v1/pdf-remove-watermarkTakes off every watermark POST /lmkit/v1/pdf-watermark laid (and any other content tagged as a watermark artifact) from every page, or from the zero-based 'pages' named. The rest of each page is untouched. The document is stored on the server and returned as a 'file_id' with the number of copies removed. A signed document is refused with 422 'signed_document' unless 'allow_signature_invalidation' consents; other unreadable inputs answer 422 as for POST /lmkit/v1/pdf-watermark.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
inputrequired | string | The source PDF document. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint. |
input_format | How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded PDF file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'. | |
pages | object (int32)[] | Zero-based indices of the pages to process. Omit for every page; an index past the last page is refused with 400. |
allow_signature_invalidation | boolean | Consent to rewriting a digitally signed document, which invalidates every signature it carries. Without it a signed input is refused with 422 'signed_document'. Default: false. |
password | string | Password used to open the source document when it is encrypted. The output is always written unencrypted. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 422 | Unprocessable Entity |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/pdf-remove-watermark" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "",
"input_format": "Base64EncodedFile",
"pages": [
"string"
],
"allow_signature_invalidation": false,
"password": "string"
}'What the watermark engine on this server accepts.#
/lmkit/v1/pdf-watermark/capabilitiesThe 'watermark.layout' values, the longest 'watermark.text', and whether fonts are installed on the server, derived from the engine. Cacheable for five minutes.
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/pdf-watermark/capabilities" \
-H "Authorization: Bearer $LMKIT_API_KEY"