NativePdfGenerator 0.1.0-preview.1
dotnet add package NativePdfGenerator --version 0.1.0-preview.1
NuGet\Install-Package NativePdfGenerator -Version 0.1.0-preview.1
<PackageReference Include="NativePdfGenerator" Version="0.1.0-preview.1" />
<PackageVersion Include="NativePdfGenerator" Version="0.1.0-preview.1" />
<PackageReference Include="NativePdfGenerator" />
paket add NativePdfGenerator --version 0.1.0-preview.1
#r "nuget: NativePdfGenerator, 0.1.0-preview.1"
#:package NativePdfGenerator@0.1.0-preview.1
#addin nuget:?package=NativePdfGenerator&version=0.1.0-preview.1&prerelease
#tool nuget:?package=NativePdfGenerator&version=0.1.0-preview.1&prerelease
NativePdfGenerator
A PDF generator written from scratch in pure C#. No external packages — BCL
only (System.IO.Compression, System.Xml.Linq, System.Globalization).
This is a writer, not a parser: it builds PDF files directly, from the low-level object model (indirect objects, content streams, cross-reference tables) up to a layout engine with pages, rows, columns, text flow and SVG.
Install
dotnet add package NativePdfGenerator
Usage
using PdfSpec;
using PdfSpec.Elements;
using PdfSpec.Fonts;
using PdfSpec.Geometry;
var doc = PdfDoc.Create()
.Info(title: "Hello", creator: "NativePdfGenerator")
.DefaultFont(StandardFont.Helvetica, 11)
.DefaultPageSize(PageSizes.A4)
.DefaultMargin(10, Unit.Mm);
doc.AddPage(PageSizes.A4, p =>
{
p.Body().Paragraph("Hello, PDF.");
p.Body().Row(r =>
{
r.FixedItem(80).Padding(8).Text("Fixed 80pt").Bold();
r.RelativeItem(2).Padding(8).Text("Grows to twice the remaining width.");
});
});
doc.Save("hello.pdf");
Repository layout
src/PdfSpec/— the library, published as theNativePdfGeneratorpackage.src/PdfSpec.Samples/— a console runner that writes sample PDFs intosamples/. Run it withdotnet run --project src/PdfSpec.Samples.
Releasing
Pushing a v* tag runs .github/workflows/release.yml, which packs
src/PdfSpec at the tag's version and publishes it to nuget.org using
trusted publishing
(OIDC — no stored API key).
git tag v1.0.0
git push origin v1.0.0
Prerelease tags work the same way (v0.1.0-preview.1); NuGet hides those
from default search and dotnet add package unless --prerelease is passed.
License
| 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.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.1 | 67 | 8/4/2026 |