GroupDocs.Assembly for .NET 26.11 is on NuGet. This release:

  • checks templates against a JSON Schema, so a template keeps working when the data is incomplete;
  • renders pages of templates and reports to images;
  • puts loading of external resources under the control of the application, and changes the default for resources referenced by data;
  • extends RemoveEmptyParagraphs to spreadsheet and plain text templates;
  • makes templates written for typed objects work on the same data loaded from JSON, XML or CSV;
  • adds a .NET Framework 4.8 build and moves the bundled engines to 26.10.

Release notes · NuGet · Documentation

Read this first: external resources referenced by data

An <<image>> or <<doc>> tag can evaluate to a URI that came from the data. When a server assembles documents from data supplied by somebody else, that URI could make the server request an address of its own network.

Since 26.11, resources whose references come from data are not loaded by default. Resources the template itself references — a linked image, an INCLUDEPICTURE field, an external link of a workbook, a literal URI in a tag — are loaded as before.

So if a template of yours renders <<image [item.PhotoUrl]>> where PhotoUrl is an http or https URI, that image is now empty until you say otherwise:

LoadSaveOptions options = new LoadSaveOptions();
options.WhitelistedResources.Add("images.example.com");   // the hosts you trust

// or, to keep the previous behaviour everywhere
options.SkipExternalResources = false;

A handler sees every decision and may supply the content itself, which is how a server with no outbound network still renders the pictures it is supposed to:

public class LocalImageHandler : ExternalResourceHandler
{
    public override void OnLoading(ExternalResourceLoadingArgs args)
    {
        Console.WriteLine($"{args.Origin} resource {args.Uri}: {(args.Skipped ? "skipped" : "allowed")}");

        if (!args.Skipped)
            args.Data = File.ReadAllBytes(LocalCopyOf(args.Uri));
    }
}

ExternalResourceOrigin tells the two cases apart: Template and Data. The full policy is on Controlling external resources.

JSON Schema for templates over incomplete data

A template can now be checked against a JSON Schema rather than against whatever the data happens to contain:

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

new DocumentAssembler().AssembleDocument(
    "Customer card.docx",
    "card.docx",
    new DataSourceInfo(dataSource, "customer"));

Members the schema declares may be used by the template even when the data has them empty, null or missing, and their types come from the schema. With this data:

{ "Name": "Quayside Bistro", "Account": "00042", "Cards": [], "Loyalty": null }

a template that reaches into customer.Cards.First().Type inside a branch that never renders no longer fails, and Account stays the string 00042 instead of becoming the number 42.

Four constructors take a schema, by path or by stream, with and without JsonDataLoadOptions. See Working with JSON data sources and Templates for incomplete data.

Document preview

DocumentAssembler.GeneratePreview renders pages of a document to images — PNG, JPEG or BMP. The document can be a template, a report GroupDocs.Assembly produced, or any other document of a supported format.

PreviewOptions previewOptions = new PreviewOptions(
    pageNumber => File.Create($"page{pageNumber}.png"),
    (pageNumber, pageStream) => pageStream.Dispose());

previewOptions.PreviewFormat = PreviewFormats.PNG;
previewOptions.PageNumbers = new[] { 1, 2 };
previewOptions.Resolution = 120;            // dots per inch, 96 by default

new DocumentAssembler().GeneratePreview("report.docx", previewOptions);

PreviewOptions follows the preview options of the other GroupDocs products, and takes a path or a stream. Two things it is immediately good for: showing a report in a browser before the reader downloads it, and proving that a Linux image has the fonts it needs. See Generating document previews.

Templates for typed objects, over file data

Dates, numbers and Booleans loaded from JSON, XML and CSV now behave the way the same values do when they come from typed objects:

  • members of dates and numbers that may be missing in a file: o.OrderDate.Month, without .Value;
  • Booleans in conditions and predicates: o.Paid ? "paid" : "due", Where(x => x.Paid);
  • $id/$ref references written by Json.NET with preserved references;
  • GroupBy and Distinct over nested objects, which compare by value.

One template therefore serves both the system that holds the data as objects and the service that receives it as a file.

Empty paragraphs in spreadsheets and text

DocumentAssemblyOptions.RemoveEmptyParagraphs has worked for word processing documents for a long time. It now covers spreadsheet and plain text templates as well, where a paragraph is a line of text — so a conditional block that renders nothing no longer leaves its blank rows behind.

Images and colors

  • An <<image>> tag may sit in a table cell of a presentation. The picture becomes the fill of the cell and repeats with the row, including rows produced by foreach. Group shapes are supported too.
  • Relative image paths are resolved against the folder of the template. For a template read from a stream, set LoadSaveOptions.ResourceLoadBaseUri.
  • Hex color strings work in backColor and in the chart color tags: <<backColor ["#FFE699"]>> alongside the named colors and the numeric form.

Dates without a time zone

A date-only value in JSON or CSV used to shift when the server ran in a different time zone — a date that was right in the data and a day earlier in the report. Date-only values now keep their date regardless of where the process runs.

Fixes

  • License.SetLicense(Stream) failed with Root element is missing.
  • Metered licensing: SetMeteredKey failed with Authentication failed.
  • Text and HTML reports lost non-Latin data when the template itself was ASCII-only.
  • Barcode generation failed when the font of its text box was not installed; a fallback is used.
  • An MSG report kept the conversation topic of the template.
  • A doc tag in a spreadsheet, presentation or text template now gives a clear error, and no empty file is left behind after a failure.
  • An extra empty paragraph after HTML content at the end of a paragraph.

.NET Framework 4.8, and the engines

The package now carries a .NET Framework 4.8 build next to 4.0 Client Profile, 4.6.2, .NET Standard 2.0, .NET 6, .NET 8 and .NET 10. The bundled document generation engines move to 26.10 (the email engine to 26.9), and System.Security.Cryptography.Pkcs is updated to the patched versions for CVE-2026-84008 and CVE-2026-70162.

How to get it

dotnet add package GroupDocs.Assembly --version 26.11.0

Or the MSI and the DLL-only ZIP from releases.groupdocs.com.

Where to start

Seven worked scenarios went up with this release. Each one is an article, a reference page and a repository you can clone and run:

Scenario Reference page Code
Generate Word and PDF documents from LLM output in C# Documents from model output llm-json-to-branded-documents-net
Generate Word documents from templates in C# Word report from a template word-report-from-template-net
Templates that survive incomplete data in C# Templates for incomplete data data-safe-templates-net
Generate Excel reports from a template in C# Excel reports from a template excel-reports-from-template-net
Generate PowerPoint presentations from JSON in C# Presentations from JSON powerpoint-decks-from-json-net
Generate and download Word and PDF reports in ASP.NET Core Reports in ASP.NET Core aspnet-core-report-download-net
Generating documents in Docker with .NET Docker and serverless document-generation-docker-net

All seven are indexed on Use cases in the documentation.

Questions and problems go to the forum.