Genocs.Fonet.XsltTransformer 3.0.1

Requires NuGet 5.0.0 or higher.

dotnet add package Genocs.Fonet.XsltTransformer --version 3.0.1
                    
NuGet\Install-Package Genocs.Fonet.XsltTransformer -Version 3.0.1
                    
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="Genocs.Fonet.XsltTransformer" Version="3.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Genocs.Fonet.XsltTransformer" Version="3.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Genocs.Fonet.XsltTransformer" />
                    
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 Genocs.Fonet.XsltTransformer --version 3.0.1
                    
#r "nuget: Genocs.Fonet.XsltTransformer, 3.0.1"
                    
#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 Genocs.Fonet.XsltTransformer@3.0.1
                    
#: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=Genocs.Fonet.XsltTransformer&version=3.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Genocs.Fonet.XsltTransformer&version=3.0.1
                    
Install as a Cake Tool

Genocs.Fonet.XsltTransformer

Genocs.Fonet Banner

XML → XSLT → XSL-FO → PDF transformation helpers for microservice applications. Builds on Genocs.Fonet to turn printable documents and XSLT templates into PDF streams. Supports net10.0, net9.0, and net8.0.

Installation

dotnet add package Genocs.Fonet.XsltTransformer

This package depends on Genocs.Fonet, Genocs.Core, and Genocs.Logging.

Getting Started

Implement IPrintableDocument (or IPayload) for your model, place XSLT templates where ResourceManager can load them, then generate a PDF:

using Genocs.Fonet.XsltTransformer.Transformers;
using Microsoft.Extensions.Logging.Abstractions;

IPrintableDocument document = /* your document */;
var pdfService = new XslFoPdfService(NullLogger<XslFoPdfService>.Instance);

using Stream pdf = pdfService.Print(
    document,
    templateName: "./templates/invoice.fo",
    resourcesName: "./templates/resources.xml",
    fontsDirectory: "./fonts",
    countryId: "IT");

Or render an already-produced XSL-FO XmlDocument directly:

using Genocs.Fonet.XsltTransformer.Transformers;

PdfPrinterDriver.MakePdf(xslFoDocument, "./output/invoice.pdf", fontDir: "fonts");
// or
using Stream pdf = PdfPrinterDriver.MakePdfStream(xslFoDocument, fontDir: "fonts");

Main Entry Points

  • IPdfWriterService / XslFoPdfService
  • IPrintableDocument / IPayload
  • PdfPrinterDriver (MakePdf, MakePdfStream)
  • XmlTransformationManager
  • ObjectXmlSerializer
  • ResourceManager
  • XsltExtensions
  • GlobalSettings

Pipeline Overview

  1. Serialize or supply an IPrintableDocument as XML (ToXml()).
  2. Load the XSLT template (and optional localized resources) via ResourceManager.
  3. Transform XML → XSL-FO with XmlTransformationManager.
  4. Render FO → PDF through PdfPrinterDriver / Genocs.Fonet.FonetDriver.

When a fonts directory is provided, private fonts are registered and embedded (FontType.Embed) so output is portable.

Configuration Notes

  • XslFoPdfService.Print requires a non-empty templateName.
  • fontsDirectory is resolved relative to the executing folder when needed (XsltExtensions.GetExecutingFolder).
  • countryId selects localized XSLT/resource variants when present.
  • PdfPrinterDriver image handling accepts data:image/...;base64,... sources used by fo:external-graphic.
  • Template and localization base paths are controlled through ResourceManager / GlobalSettings (XsltFolderPath, LocalizationXmlFolderPath, DefaultCulture, DefaultDateFormat).

Package Relationship

Package Role
Genocs.Fonet Core XSL-FO → PDF engine
Genocs.Fonet.XsltTransformer Opinionated XML/XSLT workflow on top of Genocs.Fonet

Use Genocs.Fonet alone when you already produce XSL-FO. Use this package when templates, localization XML, and document models drive PDF generation.

Linux / Docker Notes

PDF rendering relies on SkiaSharp native assets from Genocs.Fonet. In Docker/Linux hosts, reference SkiaSharp.NativeAssets.Linux on the executable project if libSkiaSharp.so is missing at runtime.

Support

Release Notes

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
3.0.1 92 10/7/2026

The change log and breaking changes are listed here.
           https://github.com/Genocs/genocs-fonet/releases