[Release] GroupDocs.Watermark for Java 26.11

Dear GroupDocs users, we’re pleased to announce GroupDocs.Watermark for Java 26.11.

This release brings two new tile patterns and the tile layout of GroupDocs.Watermark for .NET. Fonts from a folder can now have a style. Without a license, documents show a single GroupDocs evaluation message. The release also updates the bundled libraries and fixes issues in Word, Visio, PDF and email documents.

Most of the changes only add new API. Please read the Behavior changes section before upgrading: tiled watermarks are placed differently, tile spacing must be positive, and Word and PowerPoint documents no longer download linked content.

Feature — one-third offset and basket weave tile patterns
TileType.OneThirdOffset shifts every second row by two thirds of the tile step, where Offset shifts it by a half. TileType.BasketWeave lays the tiles out in alternating groups of three horizontal and three vertical watermarks.

import com.groupdocs.watermark.Watermarker;
import com.groupdocs.watermark.watermarks.Font;
import com.groupdocs.watermark.watermarks.MeasureValue;
import com.groupdocs.watermark.watermarks.TextWatermark;
import com.groupdocs.watermark.watermarks.TileMeasureType;
import com.groupdocs.watermark.watermarks.TileOptions;
import com.groupdocs.watermark.watermarks.TileType;

try (Watermarker watermarker = new Watermarker("document.pdf")) {
    TextWatermark watermark = new TextWatermark("CONFIDENTIAL", new Font("Arial", 36));
    watermark.setOpacity(0.3);

    TileOptions tileOptions = new TileOptions();
    tileOptions.setTileType(TileType.BasketWeave);

    MeasureValue lineSpacing = new MeasureValue();
    lineSpacing.setMeasureType(TileMeasureType.Percent);
    lineSpacing.setValue(10);
    tileOptions.setLineSpacing(lineSpacing);

    MeasureValue watermarkSpacing = new MeasureValue();
    watermarkSpacing.setMeasureType(TileMeasureType.Percent);
    watermarkSpacing.setValue(10);
    tileOptions.setWatermarkSpacing(watermarkSpacing);

    watermark.setTileOptions(tileOptions);
    watermarker.add(watermark);
    watermarker.save("document-tiled.pdf");
}

(WATERMARKNET-1874, WATERMARKNET-1881)

Enhancement — the .NET tile layout
Tiled watermarks are now placed the same way as in GroupDocs.Watermark for .NET, in every document format.

  • The line spacing stays the same when the tiles are rotated.
  • Rotated rows reach the edges of PDF pages and images.
  • On slides, worksheets and Word pages, tiles are no longer shifted by the watermark alignment, and the line spacing now works on slides.
  • TileOptions.setRotateAroundCenter(...) is renamed to setRotateAroundOrigin(...). With true, the tiles are rotated around the bottom left corner of the document. The old methods still work but are deprecated.
  • (WATERMARKNET-1872, WATERMARKNET-1983, WATERMARKNET-1985, WATERMARKNET-1994, WATERMARKNET-2024)

Feature — fonts from a folder with a style
The new constructor Font(String, String, float, int) takes a font folder and a combination of FontStyle constants. The old constructor with a FontStyle parameter could only receive null; it is now deprecated and creates a regular font.

Font font = new Font("DejaVu Sans", "/usr/share/fonts/truetype/dejavu", 36f, FontStyle.Bold | FontStyle.Italic);
TextWatermark watermark = new TextWatermark("DRAFT", font);

In PDF documents, bold and italic text watermarks now use the bold and italic faces of a font from a folder; before, they came out regular. A tiled PDF text watermark also keeps the folder font on every tile now. (WATERMARKJAVA-152, WATERMARKNET-1946)

Enhancement — a single evaluation message
Without a license, every document format now carries only the GroupDocs evaluation message:

“Created with evaluation version of GroupDocs.Watermark © Aspose Pty Ltd 2001-2026. All Rights Reserved.”

The evaluation messages of the embedded Aspose libraries are gone, and the year is always the year of the release. Evaluation mode also no longer limits the number of watermarks per document, and it allows adding and removing attachments, hyperlinks and other document parts. (WATERMARKJAVA-153, WATERMARKJAVA-145, WATERMARKNET-2210, WATERMARKNET-2211)

Enhancement — no network access while loading documents
Word and PowerPoint documents are loaded without downloading the content they link to, such as linked images, INCLUDEPICTURE and INCLUDETEXT fields, and linked video posters. Opening an untrusted Word or PowerPoint document no longer causes outgoing requests. (WATERMARKNET-2217)

Fix — Word documents

  • Adding a watermark to selected pages with WordProcessingWatermarkPagesOptions.setPageNumbers(...) threw a NullPointerException unless the watermark was locked. You can now place a watermark on, for example, the last page only, without protecting the document.
  • Locking a watermark with AllowOnlyFormFields duplicated the tables of the document.
  • (WATERMARKJAVA-152, WATERMARKNET-2260)

Fix — Visio, PDF and email

  • VSD, VSS, VST and VDW documents could not be saved. (WATERMARKNET-2256, WATERMARKNET-2257)
  • Image search in PDF documents did not find the images of stamp artifacts. (WATERMARKNET-2213)
  • An email attachment could turn into an embedded object after the message was saved and loaded again.

Behavior changes

  • Tile layout. Because tiled watermarks follow the .NET layout, tile positions differ from those of 26.9, mostly for rotated tiles and on slides, worksheets and Word pages.
  • Tile spacing. MeasureValue.setValue() throws an exception for zero and negative values. Before, such values produced overlapping tiles or a layout that never finished.
  • Linked content. The links in Word and PowerPoint documents stay in place, but previews and field updates no longer show remote content.
  • Evaluation messages. Without a license, Word, Excel, PowerPoint, Visio and email documents again get the GroupDocs evaluation message. In 26.9 they showed the Aspose evaluation messages instead.
  • VDW files. Aspose.Diagram cannot write VDW, so VDW documents are saved in the VDX format.

Also in this release

  • The bundled Aspose libraries are updated: Words 26.10.1, Cells 26.10, Slides 26.10, PDF 26.10, Email 26.9, Imaging 26.11, CAD 26.10, BarCode 26.10 and Tasks 26.10.
  • The bundled Apache Commons libraries are updated: IO 2.18.0, Lang 3.19.0, Compress 1.27.1 and Codec 1.17.1. The unused Jackson libraries are no longer bundled.
  • Presentation previews are rendered directly from the slide. (WATERMARKNET-2261)
  • PdfAnnotationType has five new constants: ColorBar, TrimMark, BleedMark, RegistrationMark and PageInformation.
  • The jar declares the module name com.groupdocs.watermark (Automatic-Module-Name), and the Maven metadata is updated. (WATERMARKJAVA-176)
  • License.setLicense(String) no longer fails when an environment variable has a multi-line value.

Resources