Skip to content
npond edited this page Aug 27, 2026 · 9 revisions

n8PDF

⚠️ Early — 0.1.x. n8PDF is published on NuGet and hardened — the security register is closed, fuzzers run on every push, and releases carry verifiable build provenance — but it is pre-1.0: little exposure in the wild yet, and an API not frozen until v1.0.0. See Prerelease Considerations.

n8PDF converts .docx to PDF, written from scratch. No third-party DOCX or PDF library, no headless Word, no LibreOffice, no browser engine, no sidecar service or container. A consumer adds one assembly reference and calls one method:

Converter.ConvertFile("report.docx", "report.pdf");

Everything happens inside that one assembly: the DOCX container is read, its markup parsed, styles resolved, text measured against the real font files, lines broken and pages composed, and the PDF written — including TrueType/CFF font subsetting and embedding, the Unicode bidirectional algorithm, complex-script shaping, image decoding, chart drawing and equation setting.

What sets it apart is how it matches Word: every layout rule that could not be read out of a specification was measured from Word's own output, with purpose-built probe documents designed so that only one candidate model survives the measurement. Across the comparison suite, line start positions match Word exactly, and what remains is almost everywhere a single step of the 1/300-inch grid Word itself rounds to. See Matching Word for the method.

Where to go

Page What it covers
Prerelease Considerations ⚠️ What 0.1.x / pre-1.0 means, and the posture for untrusted documents
Installation Requirements, getting the library, your first conversion, the options
The API The eight public types — the whole of what a version promises
Promises Zero dependencies, the frozen surface, warnings-as-errors, deterministic output
Security The attack surface of reading hostile documents — what is defended, and how the audit register was closed
Functionality Everything the converter implements today
Known Gaps What does not work, what is approximated, and what was declined by decision
Architecture The one-way pipeline from ZIP to PDF, and the directory map
Matching Word The fidelity method: measuring Word rather than trusting the spec
Validation The four test tiers, the three independent external checkers, and what runs where
Reporting Bugs Filing an issue, the minimal reproducing .docx, and the label/severity vocabulary
Developers Cloning, building, testing, the invariants, and how to submit a PR

Status

  • License: MIT
  • Target: .NET 10 (net10.0), one shipping library
  • Package: n8PDF on NuGet, latest 0.1.2dotnet add package n8PDF. Published via trusted publishing (OIDC from CI, no stored key) and carrying a verifiable SLSA build-provenance attestation (Installation)
  • Backlog: lives entirely in GitHub Issues. The security register from the project's own audits — over a hundred findings — is fully closed, each fix carrying its attack as a test (Security). Since then the structural-hardening epic (checked arithmetic, CodeQL + Semgrep, property/coverage-guided/continuous/differential fuzzing, threat model, supply-chain hardening, provenance) and the NuGet release have all landed, and the backlog is currently clear

Clone this wiki locally