GroupDocs.Watermark for Java Library

Streamline XLSX Watermark Management: Simplified Control

Simplify your watermark management process with our streamlined solution. Focus on your content with ease.

Adjust Xlsx document watermarks using Java

GroupDocs.Watermark for Java allows Java developers to easily adjust watermarks in many documents using their applications. Here’s a quick guide:

  1. Firstly, you need to pass Xlsx file as parameter of the Watermarker class constructor. Provide byte or file stream or a local disk path.
  2. Secondly, locate the watermarks that need to be adjusted. Use SearchCriteria to identify watermarks with the specific properties previously added to the document.
  3. Following the search, you’ll receive a list of relevant watermarks. You can then adjust their properties, including size, page alignment, text, color, image content, and more. This offers a high degree of customization for your data.
  4. Once you’ve finished adjusting the watermarks, save the updated document. You can use a local file path, or stream to store the result.
// Adjust XLSX image watermark

// Instantiate Watermarker with XLSX
Watermarker watermarker = new Watermarker("input.xlsx");

// Initialize the SearchCriteria to match a particular image
SearchCriteria searchCriteria = new ImageDctHashSearchCriteria("logo.png");
PossibleWatermarkCollection watermarks = watermarker.search(searchCriteria);

for (PossibleWatermark watermark : watermarks)
{
    // Replace image which was found
    watermark.setImageData(imageData);
}

// Save adjusted file
watermarker.save("output.xlsx");
<dependencies> <dependency> <groupId>com.groupdocs</groupId> <artifactId>groupdocs-watermark</artifactId> <version>24.8</version> </dependency> </dependencies> <repositories> <repository> <id>repository.groupdocs.com</id> <name>GroupDocs Repository</name> <url>https://repository.groupdocs.com/repo/</url> </repository> </repositories>
click to copy
copied
More examples Documentation

Advanced XLSX Watermark Management for Java Applications

The GroupDocs.Watermark API empowers developers to seamlessly integrate watermarking functionality into their Java applications. It supports adding, editing, removing, and searching for watermarks across a wide range of document formats.

Watermark Adjustment

Effortless Watermark Integration

GroupDocs.Watermark simplifies the process of adding diverse watermarks to various business documents and files within Java applications. Developers can not only apply watermarks, but also update or remove existing ones programmatically.

Granular Watermark Customization

The API provides extensive customization options for watermarks. Developers can easily adjust size, rotation, color, font, styles, and other properties to achieve the desired visual effect.

Leveraging XLSX Native Document Features

Depending on the target document format, developers can utilize native functionalities for watermark placement. These functionalities might include document page background, annotations, headers, or other objects as watermark containers.

Adjust image watermark in Spreadsheets

This examples shows how to adjust the image of the particular shapes in an Excel Worksheet.

Java


//  Load document as Spreadsheet
SpreadsheetLoadOptions loadOptions = new SpreadsheetLoadOptions();
Watermarker watermarker = new Watermarker("source.xlsx", loadOptions);

//  Get new watermark bytes
File file = new File("new_watermark.png");
byte[] imageBytes = new byte[(int) file.length()];
FileInputStream inputStream = new FileInputStream(file);
inputStream.read(imageBytes);
inputStream.close();

//  Adjust content of particular watermark
for (SpreadsheetShape shape : content.getWorksheets().get_Item(0).getShapes())
{
    if (shape.getImage() != null)
    {
        shape.setImage(new SpreadsheetWatermarkableImage(imageBytes));
    }
}

//  Save result document
watermarker.save("result.xlsx");
watermarker.close();

GroupDocs.Watermark for Java Library

Adjust Watermarks Options: Move watermarks on a page using our precision solution. GroupDocs.Watermark offers many options for watermarks adjustment and ensuring document security.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Watermark for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Use GroupDocs.Watermark for Java for watermarks edit in other files formats

Simplify your watermark management process across various document formats. Focus on your content with ease while ensuring protection and branding.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English