n8PDF 0.1.3
dotnet add package n8PDF --version 0.1.3
NuGet\Install-Package n8PDF -Version 0.1.3
<PackageReference Include="n8PDF" Version="0.1.3" />
<PackageVersion Include="n8PDF" Version="0.1.3" />
<PackageReference Include="n8PDF" />
paket add n8PDF --version 0.1.3
#r "nuget: n8PDF, 0.1.3"
#:package n8PDF@0.1.3
#addin nuget:?package=n8PDF&version=0.1.3
#tool nuget:?package=n8PDF&version=0.1.3
n8PDF
Converts .docx to PDF. Written from scratch: no third-party DOCX or PDF library, no headless
Word, LibreOffice, browser engine, sidecar service or container. One assembly, one method.
using n8PDF;
Converter.ConvertFile("report.docx", "report.pdf");
// or from bytes and streams
var pdf = Converter.Convert(File.ReadAllBytes("report.docx"));
Converter.Convert(input, output, new ConversionOptions { Title = "Quarterly report" });
The package depends on nothing but the base class library, and pulls in no native code.
What it does
Paragraphs and runs with the whole formatting cascade, tables (including styles, spans, autofit and borders), lists and numbering, headers and footers, footnotes and endnotes, fields, hyperlinks, images of every format Word embeds, floating objects with text wrapped round them, shapes and text boxes, watermarks, SmartArt, and charts — columns, bars, lines, pies, areas and scatters, with their titles, legends and data labels.
Text is measured against the real font: a from-scratch TrueType and CFF engine with kerning,
OpenType and Apple shaping, the Unicode bidirectional and line-breaking algorithms, and complex
scripts. Fonts are embedded as Type0/CIDFontType2 with a ToUnicode map, so what comes out stays
selectable and searchable.
How closely it matches Word
Every rule in it was measured against Word's own export rather than read out of the specification, and the repository holds the fixtures, the reference PDFs and the comparison harness that says so: a page's lines land within a fraction of a point of where Word puts them, and the two agree on better than 99% of the ink.
Where something is a known divergence it is written down with its numbers rather than smoothed over. See the repository's README for what is measured, what is fitted, and what is not there yet.
Fonts
By default the platform's installed fonts are discovered — read once for the process, and each face
read from its file only when a document asks for it. Register fonts explicitly through
ConversionOptions.Fonts for output that does not depend on what is installed.
| 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
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.