TXTextControl.DocumentServer.ParallelMailMerge 34.0.0

Prefix Reserved
dotnet add package TXTextControl.DocumentServer.ParallelMailMerge --version 34.0.0
                    
NuGet\Install-Package TXTextControl.DocumentServer.ParallelMailMerge -Version 34.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TXTextControl.DocumentServer.ParallelMailMerge" Version="34.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TXTextControl.DocumentServer.ParallelMailMerge" Version="34.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TXTextControl.DocumentServer.ParallelMailMerge" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TXTextControl.DocumentServer.ParallelMailMerge --version 34.0.0
                    
#r "nuget: TXTextControl.DocumentServer.ParallelMailMerge, 34.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TXTextControl.DocumentServer.ParallelMailMerge@34.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TXTextControl.DocumentServer.ParallelMailMerge&version=34.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TXTextControl.DocumentServer.ParallelMailMerge&version=34.0.0
                    
Install as a Cake Tool

TX Text Control Parallel MailMerge

TXTextControl.DocumentServer.ParallelMailMerge provides a ParallelMailMerge component for running TX Text Control MailMerge operations in isolated worker processes.

Install

dotnet add package TXTextControl.DocumentServer.ParallelMailMerge
dotnet add package TXTextControl.TextControl.Core.SDK

The consuming application must reference TX Text Control and provide a valid TX Text Control license.

Startup

Add the worker handoff as the first application code in Program.cs:

using TXTextControl.DocumentServer.Parallel;

if (await ParallelMailMerge.TryRunWorkerAsync(args))
{
    return;
}

Merge JSON Data

using TXTextControl;
using TXTextControl.DocumentServer;
using TXTextControl.DocumentServer.Parallel;

await using var mailMerge = new ParallelMailMerge(new TXWorkerOptions
{
    WorkerCount = 5
});

var result = await mailMerge.MergeJsonDataAsync(
    await File.ReadAllBytesAsync("invoice.docx"),
    FileFormat.WordprocessingML,
    await File.ReadAllTextAsync("invoice.json"),
    BinaryStreamType.AdobePDF,
    settings: new MailMergeSettings
    {
        UseTemplateFormat = true
    });

await File.WriteAllBytesAsync("invoice.pdf", result.Document);

Merge Multiple Files

Reuse one ParallelMailMerge instance and start multiple merge tasks:

using TXTextControl;
using TXTextControl.DocumentServer;
using TXTextControl.DocumentServer.Parallel;

var jobs = new[]
{
    new { Template = "invoice-1001.docx", Data = "invoice-1001.json", Output = "invoice-1001.pdf" },
    new { Template = "invoice-1002.docx", Data = "invoice-1002.json", Output = "invoice-1002.pdf" },
    new { Template = "invoice-1003.docx", Data = "invoice-1003.json", Output = "invoice-1003.pdf" }
};

await using var mailMerge = new ParallelMailMerge(new TXWorkerOptions
{
    WorkerCount = 5
});

await Task.WhenAll(jobs.Select(async job =>
{
    var result = await mailMerge.MergeJsonDataAsync(
        await File.ReadAllBytesAsync(job.Template),
        FileFormat.WordprocessingML,
        await File.ReadAllTextAsync(job.Data),
        BinaryStreamType.AdobePDF,
        settings: new MailMergeSettings
        {
            UseTemplateFormat = true
        });

    await File.WriteAllBytesAsync(job.Output, result.Document);
}));

Options

var options = new TXWorkerOptions
{
    WorkerCount = 5,
    QueueCapacityPerWorker = 128,
    StartupTimeoutSeconds = 30,
    RequestTimeoutSeconds = 120,
    RestartAttempts = 1,
    MaxMessageSizeMegabytes = 128,
    DotNetHostPath = null
};

Sample

The repository includes SimplePackageConsumer, a minimal console application that consumes the package, loads one DOCX template and one JSON data file, and writes one PDF.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
34.0.0 34 7/27/2026