[Release] GroupDocs.Assembly for Java 26.11

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

This release brings the features of GroupDocs.Assembly for .NET 26.11 to Java. Templates can be checked against a JSON Schema, pages of documents can be rendered to images, and the loading of external resources is under your control. Empty paragraphs are removed in spreadsheet and plain text templates as well, and <<image>> tags work with relative paths and in table cells of presentations. The release also updates the bundled Aspose engines to 26.10 and fixes the extra empty paragraph after HTML content reported by our customers. Java 8 remains the baseline.

Most of the changes only add new API. Please read the Behavior changes section before upgrading: external resources whose references come from data are no longer loaded by default.

Feature — JSON Schema for JSON data sources
A template is checked against the structure of its data before any <<if>> is evaluated, so a reference inside a branch that never renders failed when the data behind it was null, an empty array or missing. JsonDataSource now accepts a JSON Schema, and the template is checked against the schema instead.

JsonDataSource dataSource = new JsonDataSource("Customer.json", "Customer.schema.json");

DocumentAssembler assembler = new DocumentAssembler();
assembler.assembleDocument("Customer.docx", "Customer report.docx", new DataSourceInfo(dataSource, "customer"));

Scope.

  • Members declared in the schema can be referenced even when they are null, empty or missing in the data. Misspelled members still fail.
  • Value types come from the schema: a boolean is a Boolean, and a string of digits such as "00042" stays a string.
  • The schema can be a file or an InputStream, with or without JsonDataLoadOptions.
  • Supported keywords: type, properties, items, format (date-time, date), enum, const, allOf and local $ref. (ASSEMBLYNET-145)

Feature — document preview
DocumentAssembler.generatePreview renders pages of a template, an assembled report or any other supported document to PNG, JPEG or BMP images.

PreviewOptions options = new PreviewOptions(
    pageNumber -> new FileOutputStream("page" + pageNumber + ".png"),
    (pageNumber, pageStream) -> pageStream.close());
options.setPreviewFormat(PreviewFormats.PNG);
options.setResolution(120);   // dots per inch; 96 by default

new DocumentAssembler().generatePreview("Report.docx", options);

Scope.

  • Word processing, text and HTML documents, spreadsheets, presentations and email messages can be rendered, from a file or an InputStream.
  • setPageNumbers(...) selects pages, and setWidth(...) with setHeight(...) fits pages into a size, keeping their aspect ratio.
  • No external resources are loaded while a preview is rendered. (ASSEMBLYNET-8)

Feature — REMOVE_EMPTY_PARAGRAPHS for spreadsheet and plain text templates
DocumentAssemblyOptions.REMOVE_EMPTY_PARAGRAPHS now works for spreadsheet templates and plain text documents too. A line of a cell’s text, or of a text document, that template tags leave empty is removed with its line break, so <<if>> and <<foreach>> tags on their own lines no longer leave empty lines behind. (ASSEMBLYNET-36, ASSEMBLYNET-37)

Feature — control of external resources
An <<image>> or <<doc>> tag can take a URI from data, and GroupDocs.Assembly fetched it with no way to prevent it, so a server assembling documents from untrusted data could be made to request internal addresses. Every reference to an external resource now has an origin: TEMPLATE when the template references the resource itself, DATA when the reference comes from data.

LoadSaveOptions options = new LoadSaveOptions();
options.getWhitelistedResources().add("images.example.com");
options.setExternalResourceHandler(new ExternalResourceHandler() {
    @Override
    public void onLoading(ExternalResourceLoadingArgs args) {
        System.out.println(ExternalResourceOrigin.toString(args.getOrigin()) + " resource " + args.getUri() + ": "
            + (args.isSkipped() ? "skipped" : "allowed"));
    }
});

String photoUri = "https://images.example.com/photos/logo.png";
new DocumentAssembler().assembleDocument("Template.docx", "Report.docx", options, new DataSourceInfo(photoUri, "photo"));

Scope.

  • By default, resources referenced by the template are loaded as before, and resources whose references come from data are skipped.
  • setSkipExternalResources(false) loads all of them, and setTrustTemplateResources(false) skips the template ones too, for templates from untrusted sources.
  • getWhitelistedResources() takes host names or URI prefixes that are allowed even when skipping is on.
  • setExternalResourceHandler(...) sees every external resource and can allow it, skip it or provide its content with args.setData(...).
  • Local file paths are not external resources and are not affected. (ASSEMBLYNET-140)

Enhancement — images and colors in templates

  • An <<image>> tag works in a table cell of a presentation: the image becomes the picture fill of the cell, including cells of rows repeated by <<foreach>>. Tags in shapes of group shapes are processed as well. (ASSEMBLYNET-52)
  • A relative image path from data, such as "Images/photo.png", is resolved against the folder of the template. For a template loaded from a stream, set the folder with LoadSaveOptions.setResourceLoadBaseUri(...). (ASSEMBLYNET-62)
  • A color string can be a hex value, "#RRGGBB", "#RGB" or "#AARRGGBB", in backColor and chart color tags. (ASSEMBLYNET-25)

Enhancement — groupBy over nested objects, $id/$ref in JSON data
groupBy(o => o.Customer) and distinct() over a nested object of JSON, XML or DataSet data gave one group per row. Equal JSON and XML objects now make one group, and rows of your own DataSet are compared by identity. JSON written by Json.NET with preserved references ($id/$ref) no longer fails with a NullPointerException. (ASSEMBLYNET-157)

Fix — extra empty paragraph after HTML content
An -html expression tag at the end of its paragraph left an empty paragraph after HTML ending with a block element, such as <p>A</p><p>B</p>. The template paragraph now ends with the last HTML paragraph. Text after the tag and HTML ending with a table behave as before. (ASSEMBLYJAVA-354)

Fix — license from a stream that has been read
License.setLicense(InputStream) failed with “Unexpected EOF in prolog” when the stream had already been read, for example to license another GroupDocs product. A ByteArrayInputStream or a FileInputStream is now read from its beginning. (ASSEMBLYNET-142)

Fix — non-Latin data in text and HTML reports
An ASCII-only text or HTML template without a byte order mark gave a report in windows-1252, whatever the default charset of the JVM, so Привет was written as ??????. Such a report is now in UTF-8. (ASSEMBLYNET-158)

Fix — smaller defects

  • A missing Boolean of JSON, XML or CSV data counts as false in ?: and in the predicates of where, count, any, all and first, instead of failing with a NullPointerException. (ASSEMBLYNET-155)
  • A QR code, or another barcode whose code text is drawn by the engine, no longer fails when the font of its text box is not installed, for example Calibri on Linux. (ASSEMBLYNET-160)
  • Tags in the conversation topic of an MSG template are assembled like those of its subject. (ASSEMBLYNET-159)
  • A <<doc>> tag in a spreadsheet, presentation or text template fails with a clear message, and a failed assembleDocument leaves no empty output file. (ASSEMBLYNET-152)
  • Consumption of a metered license is reported when assembling a document or generating a preview completes. (ASSEMBLYNET-143)

Behavior changes

  • External resources from data. Resources whose references come from data are no longer loaded by default: <<image [item.PhotoUrl]>> with an https URI gives an empty image. Add the hosts to LoadSaveOptions.getWhitelistedResources(), or call setSkipExternalResources(false) to keep the previous behavior.

  • new JsonDataSource(path, null) no longer compiles, because the call is ambiguous with the new schema constructors. Cast the argument:

    new JsonDataSource(path, (JsonDataLoadOptions) null)
    
  • Text and HTML reports. Reports of ASCII-only templates are in UTF-8 instead of windows-1252. Only non-ASCII data is written differently.

  • groupBy and distinct. Over nested objects of JSON, XML and DataSet data, they merge equal objects.

  • HTML at the end of a paragraph. It no longer leaves an empty paragraph. To keep a blank line, end the HTML with <p>&nbsp;</p>.

  • DataBar Expanded barcodes. A code text of digits only is encoded as a GTIN with the (01) application identifier, using its first 13 digits. Give longer GS1 data with its application identifiers, such as (01)04901234567896(10)ABC.

  • ICustomFontsHandler.resetFontSources() is removed. Use FontSettings.resetFontSources().

Also in this release

  • The bundled Aspose engines are updated: Words 26.10.1, Cells 26.10, Slides 26.10, Email 26.9 and BarCode 26.10. They replace the early 2026 versions that security scanners reported. (ASSEMBLYJAVA-353)
  • GS1 barcodes (EAN-14, SCC-14, SSCC-18 and DataBar) keep the auto-correction of their code text with the new barcode engine. (ASSEMBLYJAVA-353)
  • The release notes list the differences from GroupDocs.Assembly for .NET 26.11, such as date-time values with an offset being printed in the time zone of the JVM.

Resources