<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-watermark</artifactId>
    <version>18.6</version>
</dependency>
copied!  
compile(group: 'com.groupdocs', name: 'groupdocs-watermark', version: '18.6')
copied!  
<dependency org="com.groupdocs" name="groupdocs-watermark" rev="18.6">
    <artifact name="groupdocs-watermark" ext="jar"/>
</dependency>
copied!  
libraryDependencies += "com.groupdocs" % "groupdocs-watermark" % "18.6"
copied!  

High Code Java API to Apply Text / Image Watermark

banner

Product Page | Docs | Demos | API Reference | Examples | Blog | Free Support | Temporary License

GroupDocs.Watermark for Java is a high code on-premise Java API for inserting watermarks to supported document types as well as embedding watermarks into images with files. Customize & stylize the digital watermarks, perform searching to fetch desired watermark, and generate document pages previews.

Text & Image Watermark Java On-premise API

  • Insert image or text watermark within the documents of supported file formats.
  • Apply watermark to images embedded within documents.
  • Extract watermark object information from a document.
  • Apply rasterization to PDF files to make the text non-searchable.
  • Search watermarks based on text formatting, text color, text font, etc.
  • Apply background image within the Microsoft Excel® & PowerPoint® documents.
  • Remove watermarks which are no longer necessary.
  • Generate document previews in PNG, JPG, or BMP formats.
  • Set proper styling to watermark and place it at the desired position within the document.
  • Support to add watermarks to:
    • Word® documents
    • PowerPoint® presentations
    • Excel® spreadsheets
    • Email attachments
    • Images & diagrams
    • PDF files
  • Add watermark to all pages of a particular type.
  • Comprehensive watermark search feature supporting various criteria, such as:
    • Text search criteria
    • Regular expression search criteria
    • Image search criteria
    • Combined search criteria
    • Text formatting search criteria
  • Searching watermarks in particular objects
  • Searching for hyperlink watermarks
  • Finding text watermark even if it contains unreadable characters between the letters

Supported Document Watermark File Formats

The following are the supported load & save file formats:

Microsoft Word®: DOC/DOT/DOCX/DOCM/DOTX/DOTM/RTF
OpenOffice Writer®: ODT
Microsoft Excel®: XLSX/XLSM/XLTM/XLT//XLTX/XLS
Microsoft PowerPoint®: PPTX/PPTM/PPSX/PPSM/PPT/PPS
Microsoft Outlook®: EML/OFT/MSG
Apple® Mail;: EMLX
Microsoft Visio® VSD/VDX/VSDX/VSTX/VSS/VSSX/VSDM/VSSM/VSTM/VTX/VSX
Fixed Layout: PDF
Image: BMP/GIF/JPG/JPEG/JPE/JP2/PNG/TIFF/WEBP

The add watermark operation is supported for the following file formats:

Microsoft Word®: DOC/DOT/DOCX/DOCM/DOTX/DOTM/RTF
OpenOffice Writer®: ODT
Microsoft Excel®: XLSX/XLSM/XLTM/XLT//XLTX/XLS
Microsoft PowerPoint®: PPTX/PPTM/PPSX/PPSM/PPT/PPS
Microsoft Visio® VSD/VDX/VSDX/VSTX/VSS/VSSX/VSDM/VSSM/VSTM/VTX/VSX
Fixed Layout: PDF
Image: BMP/GIF/JPG/JPEG/JPE/JP2/PNG/TIFF/WEBP

The search & remove watermark operations are supported for the following file formats:

Microsoft Word®: DOC/DOT/DOCX/DOCM/DOTX/DOTM/RTF
OpenOffice Writer®: ODT
Microsoft Excel®: XLSX/XLSM/XLTM/XLT//XLTX/XLS
Microsoft PowerPoint®: PPTX/PPTM/PPSX/PPSM/PPT/PPS
Microsoft Visio® VSD/VDX/VSDX/VSTX/VSS/VSSX/VSDM/VSSM/VSTM/VTX/VSX
Fixed Layout: PDF

For details and limitations please visit, Supported Document Formats.

System Requirements

  • Microsoft Windows: Windows Desktop & Server (x86, x64), Microsoft Azure
  • macOS: Mac OS X
  • Linux: Ubuntu, OpenSUSE, CentOS, and others
  • Java Versions: J2SE 7.0 (1.7), J2SE 8.0 (1.8) or above (for example Java 10)

GroupDocs.Watermark for Java does not require any external software or third party tool to be installed. Just follow one of the ways as described in Installation and Configuration.

Get Started

GroupDocs hosts all Java APIs at the GroupDocs Repository. You can easily use GroupDocs.Watermark for Java API directly in your Maven projects with simple configurations. For the detailed instructions please visit Installation from GroupDocs Repository using Maven documentation page.

Sample Java code to Add a Text Watermark to a Document

// Constants.InImagePng is an absolute or relative path to your document. Ex: "C:\\Docs\\image.png"
Watermarker watermarker = new Watermarker(Constants.InImagePng);

// Initialize the font to be used for watermark
Font font = new Font("Arial", 19, FontStyle.Bold | FontStyle.Italic);

// Create the watermark object
TextWatermark watermark = new TextWatermark("Test watermark", font);

// Set watermark properties
watermark.setForegroundColor(Color.getRed());
watermark.setBackgroundColor(Color.getBlue());
watermark.setTextAlignment(TextAlignment.Right);
watermark.setOpacity(0.5);

// Add watermark
watermarker.add(watermark);

watermarker.save(Constants.OutImagePng);

watermarker.close();

Product Page | Docs | Demos | API Reference | Examples | Blog | Free Support | Temporary License

VersionRelease Date
24.5May 28, 2024
23.12February 26, 2024
21.3January 25, 2022
20.5January 25, 2022
19.5January 25, 2022
18.3January 25, 2022
20.1January 31, 2020
18.8August 31, 2018
18.6June 19, 2018
18.2April 23, 2018