DocXmlToPDF 1.0.0

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

DocXmlToPDF

A .NET 8 C# library that generates PDF datasheet documents from XML documentation files.

Overview

DocXmlToPDF converts XML documentation (typically generated by the C# compiler) into structured PDF documents using a simple interface-based architecture. Perfect for creating professional datasheets and documentation from your existing XML documentation.

Installation

Install via NuGet Package Manager:

dotnet add package DocXmlToPDF

Or via Package Manager Console:

Install-Package DocXmlToPDF

Usage

Basic Usage

Create a PDF generator with default settings and generate a PDF from XML documentation:

// Create PDF generator with default options
var pdfGenerator = DocXmlToPdf.CreatePdfGenerator();

// Generate PDF from XML documentation
pdfGenerator.Generate("path/to/documentation.xml", "ComponentName");

// Save the generated PDF
pdfGenerator.Save("output.pdf");

Advanced Usage with Custom Options

Customize the PDF generation with specific options:

// Configure PDF generation options
var options = new PdfGeneratorOptions
{
    PageSize = PageSize.A4,
    Margin = 50f,
    HeaderFontSize = 18,
    SectionTitleFontSize = 16,
    SubsectionTitleFontSize = 14,
    BodyTextFontSize = 12,
    TableTextFontSize = 10,
    HeaderBackgroundColor = ColorConstants.LIGHT_GRAY,
    TableBorderColor = ColorConstants.GRAY,
    IncludeHeaderLines = true
};

// Create PDF generator with custom options
var pdfGenerator = DocXmlToPdf.CreatePdfGenerator(options);

// Generate and save PDF
pdfGenerator.Generate("documentation.xml", "MyComponent");
pdfGenerator.Save("customized-output.pdf");

Available Options

The PdfGeneratorOptions class provides the following configuration options:

  • PageSize: Page size for the PDF (default: A4)
  • Margin: Margin size in points (default: 40)
  • HeaderFontSize: Font size for the main title (default: 16)
  • SectionTitleFontSize: Font size for section titles (default: 14)
  • SubsectionTitleFontSize: Font size for subsection titles (default: 12)
  • BodyTextFontSize: Font size for body text (default: 11)
  • TableTextFontSize: Font size for table content (default: 9)
  • HeaderBackgroundColor: Background color for table headers (default: light gray)
  • TableBorderColor: Border color for tables (default: gray)
  • IncludeHeaderLines: Whether to include separator lines around the header (default: true)

Requirements

  • .NET 8.0 or higher
  • iText7 PDF library
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 was computed.  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 was computed.  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
1.0.0 164 9/13/2025

Initial release of DocXmlToPDF library for converting XML documentation to PDF datasheets.