GroupDocs.Watermark library provides ability to manipulate with different watermark types such as TextWatermark, ImageWatermark. These watermarks could be added to document, updated, removed, or searched inside already watermarked documents. Our product also provides information about document type and structure - file type, size, pages count, etc. and generates document pages preview based on provided options.
Here are main GroupDocs.Watermark API concepts:
Watermarker is the main class that contains all required methods for manipulating with document watermarks.
Most part of methods expects different options to add, update, search or remove watermarks inside document.
Watermarker object definition
The following code shows most used code pattern to define Watermarker object and call its methods.
// Add text watermark to PDF document Watermarker watermarker = new Watermarker("document.pdf"); TextWatermark watermark = new TextWatermark("Test watermark", new Font("Arial", 36, FontStyle.Bold | FontStyle.Italic)); watermarker.add(watermark); watermarker.save("Watermarked_document.pdf"); watermarker.close();
Let’s review common usage scenarios when documents and watermarks are stored in a local drive and you want to manage them using GroupDocs.Watermark API:
Advanced usage topics
To learn more about document watermarking features and get familiar how to manage watermarks and more, please refer to theadvanced usage section.
You may easily run the code above and see the feature in action in our GitHub examples:
Free online document watermarking App
Along with full featured Java library we provide simple, but powerful free Apps.
You are welcome to add watermark to PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, Emails and more with our free online Free Online Document Watermarking App.