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
<PackageReference Include="TXTextControl.DocumentServer.ParallelMailMerge" Version="34.0.0" />
<PackageVersion Include="TXTextControl.DocumentServer.ParallelMailMerge" Version="34.0.0" />
<PackageReference Include="TXTextControl.DocumentServer.ParallelMailMerge" />
paket add TXTextControl.DocumentServer.ParallelMailMerge --version 34.0.0
#r "nuget: TXTextControl.DocumentServer.ParallelMailMerge, 34.0.0"
#:package TXTextControl.DocumentServer.ParallelMailMerge@34.0.0
#addin nuget:?package=TXTextControl.DocumentServer.ParallelMailMerge&version=34.0.0
#tool nuget:?package=TXTextControl.DocumentServer.ParallelMailMerge&version=34.0.0
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 | Versions 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. |
-
net10.0
- TXTextControl.TextControl.Core.SDK (>= 34.0.4)
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 |