GroupDocs.Watermark for Java 26.11 Release Notes

Major Features, Enhancements and Fixes

Tiled watermarks. Two new tile patterns are available: TileType.OneThirdOffset and TileType.BasketWeave. The tile layout now works 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 of tiles 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 works on slides.

TileOptions.setRotateAroundCenter is renamed to setRotateAroundOrigin; the old name still works.

Fonts from a folder with a style. The new constructor Font(String, String, float, int) combines a font folder with FontStyle constants. In PDF documents, bold and italic text watermarks now use the bold and italic faces of a font read from a folder.

Evaluation mode. Without a license, a document carries only the GroupDocs evaluation message, in every format: “Created with evaluation version of GroupDocs.Watermark © Aspose Pty Ltd 2001-2026. All Rights Reserved.” The evaluation messages of the embedded Aspose libraries no longer appear. Evaluation mode also no longer limits the number of watermarks per document, and it allows adding and removing document parts such as attachments and hyperlinks.

Security.

  • Word and PowerPoint documents are loaded without fetching external resources such as linked images.
  • The bundled Aspose libraries are updated to current versions.
  • The bundled Apache Commons libraries are updated, and the unused Jackson libraries are no longer bundled.

Fixes.

  • Word: adding a watermark to selected pages without locking it threw a NullPointerException.
  • Word: locking a watermark with AllowOnlyFormFields duplicated the tables of the document.
  • Visio: VSD, VSS, VST and VDW documents could not be saved.
  • PDF: image search did not find the images of stamp artifacts.
  • Email: an attachment could turn into an embedded object after the message was saved and loaded again.
  • License.setLicense(String) failed when the environment contained a variable with a multi-line value.

Full List of Features Covering all Changes in this Release

KeyCategorySummary
WATERMARKNET-1874★ FeatureOne-third offset tile pattern: TileType.OneThirdOffset
WATERMARKNET-1881★ FeatureBasket weave tile pattern: TileType.BasketWeave
WATERMARKJAVA-152★ FeatureFont(String, String, float, int): a font from a folder with a FontStyle combination
WATERMARKNET-1994, WATERMARKNET-2024✜ EnhancementTile layout ported from .NET: constant line spacing under rotation, rotated rows reach the page edges
WATERMARKNET-1872✜ EnhancementTileOptions.RotateAroundCenter renamed to RotateAroundOrigin; the old accessors are deprecated
WATERMARKNET-1946✜ EnhancementPDF: bold and italic text watermarks use the bold and italic faces of a font from a folder
WATERMARKJAVA-153, WATERMARKJAVA-145✜ EnhancementEvaluation mode: only the GroupDocs evaluation message, in every format and with the current year
WATERMARKNET-2210✜ EnhancementEvaluation mode: no limit on the number of watermarks per document
WATERMARKNET-2211✜ EnhancementEvaluation mode: document parts can be added and removed
WATERMARKNET-2217✜ EnhancementWord and PowerPoint documents are loaded without fetching external resources
WATERMARKJAVA-182✜ EnhancementAspose libraries 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, Tasks 26.10
WATERMARKJAVA-182✜ EnhancementApache Commons updated: IO 2.18.0, Lang 3.19.0, Compress 1.27.1, Codec 1.17.1; Jackson is no longer bundled
WATERMARKNET-2261✜ EnhancementPresentation previews are rendered directly from the slide
WATERMARKJAVA✜ EnhancementPdfAnnotationType: ColorBar, TrimMark, BleedMark, RegistrationMark and PageInformation
WATERMARKJAVA✜ EnhancementThe jar manifest declares Automatic-Module-Name: com.groupdocs.watermark
WATERMARKJAVA-176✜ EnhancementMaven metadata: product name, description, organization, SCM, license and developers
WATERMARKJAVA-199✜ EnhancementEULA and documentation links point to the current pages
WATERMARKNET-1983🔧 FixTiled watermarks on slides, worksheets and Word pages were shifted by the alignment; the line spacing had almost no effect on slides
WATERMARKNET-1985🔧 FixWrong rotation coordinates of tiled watermarks
WATERMARKNET-1956🔧 FixTile spacing accepted zero and negative values
WATERMARKJAVA-152🔧 FixWord: adding a watermark to selected pages without a lock threw NullPointerException
WATERMARKJAVA-152🔧 FixFont(String, String, float, FontStyle) threw NullPointerException
WATERMARKJAVA-152🔧 FixA copied text watermark lost its font folder, so tiled PDF text watermarks did not use the folder font
WATERMARKNET-2260🔧 FixWord: locking a watermark with AllowOnlyFormFields duplicated tables
WATERMARKNET-2260🔧 FixWord: setLocked(true) with WordProcessingLockType.NoLock threw an exception without a message
WATERMARKNET-2256, WATERMARKNET-2257🔧 FixVisio: VSD, VSS, VST and VDW documents could not be saved
WATERMARKNET-2213🔧 FixPDF: image search did not find the images of stamp artifacts
WATERMARKJAVA🔧 FixEmail: an attachment could turn into an embedded object after saving and loading
WATERMARKJAVA🔧 FixLicense.setLicense(String) threw StringIndexOutOfBoundsException when an environment variable had a multi-line value

Public API and Backward Incompatible Changes

New tile patterns

TileType has two new values:

  • OneThirdOffset: every second row is shifted by two thirds of the tile step (by a half with Offset);
  • BasketWeave: tiles are laid out in alternating groups of three horizontal and three vertical watermarks. The rotation angle of the watermark is ignored.
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");
}

TileOptions.RotateAroundOrigin

TileOptions.isRotateAroundOrigin() and TileOptions.setRotateAroundOrigin(boolean) were added:

  • true: the tiles are rotated around the bottom left corner of the document;
  • false (the default): each row of tiles is rotated relative to the left edge of the document.

isRotateAroundCenter() and setRotateAroundCenter(boolean) are deprecated and call the new methods.

Font from a folder with a style

public Font(String fontFamilyName, String folderPath, float size, int style)

The style parameter takes a combination of the FontStyle constants. FontStyle holds int constants and has no instances, so the Font(String, String, float, FontStyle) constructor could only receive null and threw a NullPointerException. 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);

PdfAnnotationType

PdfAnnotationType has five new constants for printer’s mark annotations:

  • ColorBar
  • TrimMark
  • BleedMark
  • RegistrationMark
  • PageInformation

Behavior changes

  • Tile layout. Tiled watermarks follow the .NET layout, so tile positions differ from those of 26.9. This matters most for rotated tiles and for slides, worksheets and Word pages. Check the output if you compare documents with reference files.
  • Tile spacing must be positive. MeasureValue.setValue() throws an exception with the message “Value must be greater than 0.” for zero and negative values. Before 26.11 such values produced overlapping tiles or a layout that never finished.
  • No external resources on load. Word and PowerPoint documents no longer download the content they link to. This covers linked images, INCLUDEPICTURE and INCLUDETEXT fields, and linked video posters. The links themselves stay in the document; only previews and field updates no longer show the 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 evaluation messages of the Aspose libraries instead. The message is placed as follows:
    • Word: a paragraph or a watermark;
    • Excel: a locked shape and a footer;
    • PowerPoint: a locked shape on the slides;
    • Visio: a locked shape on the pages and a header;
    • email: the subject.
  • VDW is saved as VDX. Aspose.Diagram can read VDW files but cannot write them, so a VDW document is saved in the VDX format.
  • Presentation previews. Slides are rendered directly to the requested format, so preview pixels can differ slightly from those of 26.9. The image size is the same as before.
  • Bundled third-party libraries. Jackson is no longer bundled in the jar. Commons IO, Lang, Compress and Codec are bundled in the versions listed above.