Nedev.FileConverters.DocxToPdf
0.1.0
dotnet add package Nedev.FileConverters.DocxToPdf --version 0.1.0
NuGet\Install-Package Nedev.FileConverters.DocxToPdf -Version 0.1.0
<PackageReference Include="Nedev.FileConverters.DocxToPdf" Version="0.1.0" />
<PackageVersion Include="Nedev.FileConverters.DocxToPdf" Version="0.1.0" />
<PackageReference Include="Nedev.FileConverters.DocxToPdf" />
paket add Nedev.FileConverters.DocxToPdf --version 0.1.0
#r "nuget: Nedev.FileConverters.DocxToPdf, 0.1.0"
#:package Nedev.FileConverters.DocxToPdf@0.1.0
#addin nuget:?package=Nedev.FileConverters.DocxToPdf&version=0.1.0
#tool nuget:?package=Nedev.FileConverters.DocxToPdf&version=0.1.0
DocxToPdf
A high-performance .NET 10 library and CLI tool for converting DOCX files to PDF using a custom-built PDF engine.
🌟 Features
- Rich Document Support: Converts complex DOCX elements including:
- Paragraphs with advanced styling (indentation, spacing, alignment).
- Multi-level lists and numbering.
- Tables with cell merging, borders, and custom background colors.
- Images (Inline and Floating) with support for text wrapping (Square, Tight, Through, Top/Bottom).
- Hyperlinks and Bookmarks.
- Advanced Layout:
- Multi-column page layouts.
- Section-specific page settings (size, margins, orientation).
- Headers and Footers (Different first page, even/odd support).
- Professional Enhancements:
- Dynamic Watermarks (Text-based).
- Document Field Resolution (DATE, AUTHOR, TITLE, etc.).
- Footnotes and Endnotes support.
- Comments Summary Page generation.
- Custom PDF Engine: Built on top of a specialized PDF generation layer for precise control over rendering.
🛠 Technical Stack
- Framework: .NET 10
- Core Dependencies:
DocumentFormat.OpenXml: For robust DOCX parsing.SkiaSharp: For high-quality text and image rendering.Nedev.FileConverters.Core(>=0.1.0): shared converter interfaces and discovery
- Architecture: Modular converter design with dedicated processors for paragraphs, tables, images, and lists.
🚀 Getting Started
Prerequisites
- .NET 10 SDK
Installation
Clone the repository and build the project:
git clone <repository-url>
cd Nedev.FileConverters.DocxToPdf/src
dotnet build
Usage (CLI)
There is now a dedicated console application under src/Nedev.FileConverters.DocxToPdf.Cli.
You can invoke it using the CLI project:
cd Nedev.FileConverters.DocxToPdf/src/Nedev.FileConverters.DocxToPdf.Cli
dotnet run -- <input.docx> <output.pdf>
When run without arguments, it defaults to test.docx → test.pdf.
The CLI also demonstrates how to call the shared Nedev.FileConverters.Converter entry point. In a host application you can simply load this assembly (or reference the project) and use:
using Nedev.FileConverters;
using var outStream = Converter.Convert(inStream, "docx", "pdf");
Because DocxToPdfConverter is attributed, the core library will discover and instantiate it automatically when a conversion is requested.
For applications using dependency injection you can register the converter in two ways:
// using core method directly:
services.AddFileConverter("docx", "pdf", new DocxToPdfConverter());
// or via the convenience helper provided by this library:
services.AddDocxToPdf();
📂 Project Structure
src/Nedev.FileConverters.DocxToPdfConverter.cs: The main orchestration logic for the conversion process. ImplementsIFileConverterand is decorated with[FileConverter("docx","pdf")]so it is automatically discovered by the core library.src/PdfEngine/: Core PDF generation and rendering engine.src/Converters/: Specialized logic for handling different DOCX elements (Tables, Images, etc.).src/Helpers/: Utility classes for font handling, styling, and OpenXml extensions.src/Models/: Data models used during the conversion process (now extends/works alongside core models if applicable).src/Nedev.FileConverters.DocxToPdf.Cli: Simple console application demonstrating both direct andNedev.FileConverters.Converterusage.
📄 License
[Insert License Information Here]
| 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.4.1)
- Nedev.FileConverters.Core (>= 0.1.0)
- SkiaSharp (>= 3.119.2)
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 |
|---|---|---|
| 0.1.0 | 98 | 3/6/2026 |