Nutrient DWS API is an HTTP API that lets you add watermarks to your documents. Use the PDF Watermark API to add text or image watermarks to PDFs via a single API call.
Why Nutrient DWS API?
SOC 2 Compliant
Build the workflows you need without worrying about security. We don’t store any document data, and our API endpoints are served through encrypted connections.
Easy Integration
Get up and running in hours, not weeks. Access well-documented APIs and code samples that make integrating with your existing workflows a snap.
Robust and Flexible
With access to more than 30 tools, you can process one document in multiple ways by using API credits. Generate PDF from HTML, convert Word, Excel, PowerPoint and image files to PDF, and more.
Simple and Transparent Pricing
Select a package that suits your needs according to the number of credits you wish to spend. Each API tool and action has a specific credit cost.
Try It Out
This example will watermark all the pages of your document with the supplied logo.
Add a PDF named document.pdf and an image file named logo.png to your project folder. You can also use our sample PDF and our sample image.
The file name is case sensitive. Make sure the file name matches the file name in the sample code.The file name is case sensitive. Make sure the file name matches the file name in the sample code.
The following sections show more examples of how the watermark API can be used.
Multiple Watermarks
This example will add multiple watermarks to the document. The image watermark will be placed in the center of
the screen, while the text will be positioned in the bottom left corner. The text watermark's opacity and font
attributes can also be customized.
This example will watermark the last page of the document. To do so, declare a part consisting of all pages of
the source document but the last one, and a part with the last page and an image watermark action.
The following schema shows all the options and valid inputs for the watermark action.
Typescript
// The size of the watermark can either be a positive integer or a percentage (e.g. representing a ratio of the page dimension).typeDimension=number|string;// The position of the watermark can either be a non-negative integer or a percentage (e.g. representing a ratio of the page dimension).typePosition=number|string;// Represents one part that was sent in the multipart request. Should be the// `name` that was specified for the part.typeMultipartReference=string;typeWatermarkAction={
type:"watermark",// Only either "text" or "image" can be specified.
text?:string,// When specified, this is the text that the watermark will contain.
image?: MultipartReference,// When specified, this is the image that will be used as the watermark.// For images, one dimension needs to be specified. For text watermarks, both dimensions need to be specified.
width?: Dimension,
height?: Dimension,// The position defaults to the center of the page.// You can only specify one position per axis, so either:// top or bottom// and either// left or right.
top?: Position,
right?: Position,
bottom?: Position,
left?: Position,// The value of opacity should be between 0 and 1.
opacity?: float,// Angle of rotation in degrees. Should be between 0 and 360.
rotation?: integer,// Font and styling (Only valid for text watermarks)
fontSize?: integer,
fontColor?:string,// Font color as hex code. Example: "#FF0000".
fontStyle?:string[],// Either ["italic", "bold"], or any one of them.
fontFamily?:string,// String describing the font family.};