LinkSoft.WordTemplateToPdf
10.0.0
Prefix Reserved
dotnet add package LinkSoft.WordTemplateToPdf --version 10.0.0
NuGet\Install-Package LinkSoft.WordTemplateToPdf -Version 10.0.0
<PackageReference Include="LinkSoft.WordTemplateToPdf" Version="10.0.0" />
<PackageVersion Include="LinkSoft.WordTemplateToPdf" Version="10.0.0" />
<PackageReference Include="LinkSoft.WordTemplateToPdf" />
paket add LinkSoft.WordTemplateToPdf --version 10.0.0
#r "nuget: LinkSoft.WordTemplateToPdf, 10.0.0"
#:package LinkSoft.WordTemplateToPdf@10.0.0
#addin nuget:?package=LinkSoft.WordTemplateToPdf&version=10.0.0
#tool nuget:?package=LinkSoft.WordTemplateToPdf&version=10.0.0
The purpose of this package is to fill DOCX templates from JSON data and convert the generated document to PDF using LibreOffice headless mode.
The package targets the repository-wide .NET version configured in common/common.props (net9.0).
Configuration:
using LinkSoft.WordTemplateToPdf;
var converter = new WordTemplateToPdfConverter(new WordTemplateToPdfConverterOptions
{
// Required. Output and LibreOffice working files are created here.
TemporaryFolderPath = "/var/tmp/linksoft-documents",
// Optional. If omitted, `libreoffice` is expected to be available in PATH.
LibreOfficePath = "/usr/bin/libreoffice"
});
Usage:
var result = await converter.ConvertAsync(
docxFileName: "contract.docx",
jsonFileName: "contract-data.json");
Console.WriteLine(result.PdfPath);
The DOCX file name and JSON file name are supplied for every conversion run. Relative names are resolved from TemporaryFolderPath first and then from the current working directory; rooted paths are used as-is. The JSON root must be an object. Property names map directly to template placeholders without brackets.
Output files are written directly into TemporaryFolderPath as NEW_<docx file name> and NEW_<docx file name without extension>.pdf.
{
"CustomerName": "Jane Doe",
"ContractNumber": "C-2026-0001",
"Amount": 123.45
}
Templates must use [[Name]] placeholders. For example, the JSON property Name fills the Word placeholder [[Name]].
This package is a part of larger set of packages for LinkSoft Technologies shared open source repository.
You can find the repository on GitHub.
| 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
- DocumentFormat.OpenXml (>= 3.1.1)
- MiniWord (>= 0.9.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial Word template to PDF converter.