GroupDocs.Watermark for Java API

Automate Excel Watermarking with Java Code

Implement custom text or image watermarks in Excel spreadsheets using Java. This guide offers step-by-step instructions for enhancing document security and branding, tailored for a variety of professional needs.

Add Watermark to Excel Document via Java

GroupDocs.Watermark for Java makes it easy for Java developers to add watermarks of various types to popular business file formats. Add our library to your application and watermark documents in a few easy steps as listed below.

  1. The main class of our API is Watermarker. You need to instantiate it before document processing. Do not forget to pass the Excel file to the constructor as a path or a stream object.
  2. The next step is constructing a Watermark object of the desired type. It can be placed not only on a specific document page but also in native document parts like attachments or headers.
  3. Set watermark properties such as height and width, page alignment (top, left, central, etc.), font family and color, and many others.
  4. Call the Watermarker method to add a new watermark. You can add as many watermarks as you need. It is recommended to save the processed document to another location.

// Add text watermark to EXCEL

// Pass file to be watermarked to Watermarker
Watermarker watermarker = new Watermarker("input.xslx");

// Create text watermark and set up properties
TextWatermark watermark = new TextWatermark("My Watermark", new Font("Arial", 36));
watermark.setForegroundColor(Color.getRed());

// Save watermarked file
watermarker.add(watermark);
watermarker.save("output.xslx");
<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

Enhance Your Watermarks Easily

Harness the power of GroupDocs.Watermark to generate, compose, and add watermarks across multiple document formats. This API not only enhances document security but also protects your intellectual property by embedding customizable watermarks that are both versatile and robust.

Add Watermark

Versatile Watermark Options

Explore a wide range of watermarking options with GroupDocs.Watermark. From adjusting opacity and rotation to scaling size proportionally, our API lets you customize watermarks precisely to your needs, ensuring that they blend seamlessly with your documents while maintaining content integrity.

Advanced Watermark Styling

GroupDocs.Watermark allows you to style your watermarks with various fonts, colors, and shadows, making them distinctive and harder to remove. Enhance the aesthetic appeal of your protected documents and images with stylish watermarks that reflect your brand’s identity and professionalism.

Watermark Tiling & Positioning

With GroupDocs.Watermark, implement tiling effects to cover your entire document, ensuring complete protection. Position watermarks exactly where you need them—center, corner, or custom locations. Our flexible positioning options help safeguard your documents against unauthorized use and duplication.

PDF annotation watermark

This example shows how to add watermark annotation to a PDF document

Java


//  Load document as PDF
PdfLoadOptions loadOptions = new PdfLoadOptions();
Watermarker watermarker = new Watermarker("source.pdf", loadOptions);

//  Create watermark based on PDF annotation
PdfAnnotationWatermarkOptions options = new PdfAnnotationWatermarkOptions();
TextWatermark textWatermark = new TextWatermark("Annotation watermark", new Font("Arial", 8));

//  Set up watermark options
textWatermark.setHorizontalAlignment(HorizontalAlignment.Left);
textWatermark.setVerticalAlignment(VerticalAlignment.Top);

//  Add text watermark to result document
watermarker.add(textWatermark, options);
watermarker.save("result.pdf");

GroupDocs.Watermark for Java library

GroupDocs.Watermark for Java offers comprehensive watermark management in Excel spreadsheets, enabling developers to easily generate, adjust, and clear watermarks. It supports all popular Excel file formats, allowing the embedding of both text and image watermarks that can be customized in font, color, size, and position. GroupDocs.Watermark also includes features for watermark searching, ensuring that your watermarks are intact and tamper-proof. Ideal for applications requiring document security enhancements within Java environments.
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.

Java Techniques for Excel Watermarking

Using GroupDocs.Watermark for Java, easily apply text or image-based watermarks to Excel spreadsheets, significantly boosting document security and branding as part of your business workflow.

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