[Release] GroupDocs.Watermark for Java 26.9

Dear GroupDocs users, we’re pleased to announce GroupDocs.Watermark for Java 26.9. This release updates every document-format engine the library is built on, lifts the evaluation-mode limit on the number of documents you can load, and fixes a group of issues that only showed up in the released build — native font-metrics calls, license application, embedded email objects, PDF annotation watermarks and PNG previews of Word documents. The public API is unchanged; there is one behaviour change in preview generation, described below.

Update — all document engines updated

Every Aspose engine has been updated, in most cases across several major versions. This is the largest part of the release and affects rendering, format detection and licensing behaviour across all supported formats.

Engine 26.4 26.9
Aspose.CAD 23.1 24.6.1
Aspose.Cells 23.6 26.3
Aspose.Diagram 23.6 25.10
Aspose.Email 23.5 26.1
Aspose.Imaging 25.8 25.12
Aspose.PDF 23.4 26.2
Aspose.Slides 23.3 26.2
Aspose.Words 23.6 26.3
Aspose.BarCode 23.5 25.5
Aspose.Tasks 23.1 25.9
Aspose.PSD 21.7 25.10

Aspose.Note, Aspose.HTML and Aspose.Drawing are unchanged. (WATERMARKJAVA-155)

Change — evaluation mode

Two changes to how the library behaves without a license, aligned with the .NET version.

Scope.

  • The limit on the number of documents that could be loaded per application run in evaluation mode has been removed. Previously an InvalidOperationException was thrown once the limit was exceeded. (WATERMARKNET-2175)
  • The custom evaluation watermark is no longer added to Diagram, Email, Presentation, Spreadsheet and WordProcessing documents. PDF documents keep it, and image documents now carry the full evaluation text instead of the compact variant. (WATERMARKNET-2189)
  • Licensed behaviour is unchanged.

Fix — native font-metrics calls in the released build

Every native call made by the Aspose.Words engine failed with UnsatisfiedLinkError in the released (obfuscated) jar. Depending on the operation, this either filled the console with SEVERE stack traces while the call still returned a correct result, or aborted the operation outright.

Symptoms that are resolved.

  • Watermarker.getDocumentInfo() on a DOCX file returned the correct page count and size, but logged UnsatisfiedLinkError stack traces for every call.
  • Adding a text watermark to an RTF file with SizingType.ScaleToParentDimensions failed with UnsatisfiedLinkError instead of producing the document.

The failing method reads font metrics from the Windows registry. The class exposing it is now kept in the package its native library expects, so all native entry points resolve again.

Fix — license could not be applied in the released build

License.setLicense() failed with a message-less IllegalAccessError raised inside the Aspose.Tasks engine, which made the library unusable in licensed mode in the released jar. The engine reads its licensing resource from a fixed internal path; that resource is now present in the released jar at the path the engine expects.

import com.groupdocs.watermark.licenses.License;

License license = new License();
license.setLicense("GroupDocs.Watermark.lic"); // no longer throws IllegalAccessError

Fix — embedded email objects lost their Content-ID

An object added to an email message through getEmbeddedObjects().add(...) was written out as a plain attachment, so the cid: reference in the HTML body no longer resolved after saving and reloading the message. A Content-ID is now assigned to every embedded object, and the image stays embedded.

try (Watermarker watermarker = new Watermarker("message.msg", new EmailLoadOptions())) {
    EmailContent content = watermarker.getContent(EmailContent.class);

    content.getEmbeddedObjects().add(Files.readAllBytes(Paths.get("icon.png")), "icon.png");
    EmailEmbeddedObject embedded = content.getEmbeddedObjects()
            .get_Item(content.getEmbeddedObjects().getCount() - 1);

    content.setHtmlBody("<html><body><img src=\"cid:" + embedded.getContentId() + "\"></body></html>");
    watermarker.save("output.msg");
}

Fix — PDF annotation watermarks on documents with custom page boxes

Adding an annotation watermark threw an out-of-range error when PdfContent.setPageMarginType() was set to ArtBox, BleedBox or TrimBox. Annotation watermarks now work for all page margin types.

Fix — PNG previews of WordProcessing documents

generatePreview() with PreviewFormats.PNG produced an empty stream for Word documents, while JPEG worked correctly. PNG previews are now generated as expected.

Behaviour change. The page stream passed to your ICreatePageStream implementation is now closed by the engine once the page has been written — this is what makes PNG output complete. IReleasePageStream is still called afterwards, so implementations that simply close or release the stream continue to work. If your code reads from that stream after generatePreview() returns, assuming it is still open, it needs to be adjusted.

Change — released artifacts are PGP-signed

Released artifacts are now signed with a PGP key: .asc signature files are published next to the jar, pom and javadoc in the repository. (WATERMARKJAVA-157)

Resources