DocXmlToPDF 1.0.0
dotnet add package DocXmlToPDF --version 1.0.0
NuGet\Install-Package DocXmlToPDF -Version 1.0.0
<PackageReference Include="DocXmlToPDF" Version="1.0.0" />
<PackageVersion Include="DocXmlToPDF" Version="1.0.0" />
<PackageReference Include="DocXmlToPDF" />
paket add DocXmlToPDF --version 1.0.0
#r "nuget: DocXmlToPDF, 1.0.0"
#:package DocXmlToPDF@1.0.0
#addin nuget:?package=DocXmlToPDF&version=1.0.0
#tool nuget:?package=DocXmlToPDF&version=1.0.0
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 | Versions 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. |
-
net8.0
- itext (>= 9.2.0)
- itext7.bouncy-castle-adapter (>= 9.2.0)
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.