Skip to content
ComPDF
DemoAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Remove Watermark API

Remove watermarks from a PDF.

Feature

The ComPDF Self-hosted accepts files and a request JSON string through multipart/form-data, forwards the parameters to the private PDF SDK, and streams the result file back on success.

Synchronous Request

ItemValue
Authenticationx-api-key: your_api_key_here
Request URLPOST http://localhost:8080/api/v1/process/pdf/watermark/remove
Content typemultipart/form-data
Success responseResult file stream

Request Parameters

ParameterTypeDescriptionRequired
fileFileSource PDF file.Yes
requestStringJSON string containing the PDF SDK parameters below. If omitted, remaining non-file form-data fields are forwarded as the request object.No

Request Object Parameters

Put the following fields in the request JSON string.

ParameterTypePurpose
pagesString or Number[]Pages to process. Examples: 1, 1,3-5, [1,3,4,5], or all when supported.
modeStringRemove watermark mode. The ComPDF Web sends tagged; the ComPDF Self-hosted switches to untagged when specific pages are provided.
passwordStringSource PDF open password. Some routes remove it before forwarding when the SDK endpoint does not accept it directly.
outputFileNameStringOptional output filename. When present, it is used as the preferred download filename.

Request Example

bash
curl -X POST "http://localhost:8080/api/v1/process/pdf/watermark/remove" \
  -H "x-api-key: your_api_key_here" \
  -F "[email protected]" \
  -F 'request={"pages":"1,3-5","mode":"tagged"}'

Response

On success, the API returns the processed file stream with Content-Type and Content-Disposition headers. On failure, ComPDF Self-hosted returns the normalized error response described in Definition of Error Codes, including type, code, errorCode, message, and traceId.