EgoPDF.Generator
2.2.1
See the version list below for details.
dotnet add package EgoPDF.Generator --version 2.2.1
NuGet\Install-Package EgoPDF.Generator -Version 2.2.1
<PackageReference Include="EgoPDF.Generator" Version="2.2.1" />
<PackageVersion Include="EgoPDF.Generator" Version="2.2.1" />
<PackageReference Include="EgoPDF.Generator" />
paket add EgoPDF.Generator --version 2.2.1
#r "nuget: EgoPDF.Generator, 2.2.1"
#:package EgoPDF.Generator@2.2.1
#addin nuget:?package=EgoPDF.Generator&version=2.2.1
#tool nuget:?package=EgoPDF.Generator&version=2.2.1
EgoPDF.Generator
C# port of FPDF with bug fixes and modern additions (SkiaSharp-driven font metrics, embedded TrueType fonts with valid PDF descriptors, page-size and image helpers).
If you also need to render Zebra ZPL labels to PDF, add the companion
preview package EgoPDF.Barcodes.
Quick start
using Ego.PDF;
using Ego.PDF.Data;
using var pdf = new FPdf("hello.pdf");
pdf.AddPage(PageSizeEnum.A4);
pdf.SetFont("Helvetica", "B", 24);
pdf.Cell(0, 10, "Hello from EgoPDF!");
pdf.Close();
That writes a one-page A4 PDF with the text in Helvetica-Bold. The PDF
core fonts (Helvetica, Courier, Times) are never embedded; load a TTF
with pdf.LoadFont("RobotoSlab", "path/to/RobotoSlab-Regular.ttf");
and pdf.AddFont("RobotoSlab", ""); to embed a custom face.
What's in the box
- The full FPDF API (text, lines, rectangles, cells, multi-cell, images, links, font scale, page sizes / orientations).
- SkiaSharp-based metrics for embedded TrueType fonts — no .php tool
generation step needed, just hand
LoadFonta.ttfpath. - Embedded fonts emit valid PDF descriptors (PostScript-safe
BaseFontnames, realFontBBox, non-zeroStemV, italic / bold / monospace flags) so Acrobat in strict mode accepts them. - Image embedding for PNG / JPEG / GIF, with on-the-fly format detection via Skia codecs.
Targets
- net8.0
- net9.0
License
MIT. See the NOTICE file shipped with the package for the FPDF
acknowledgment — the substantial portions inherited from the PHP
project's automated port are reused under FPDF's permissive notice,
the rest is original work under MIT.
| 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 is compatible. 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. |
NuGet packages (2)
Showing the top 2 NuGet packages that depend on EgoPDF.Generator:
| Package | Downloads |
|---|---|
|
EgoPDF.Barcodes
Render barcodes (Code 128, Code 39, Code 93, Interleaved 2 of 5, Codabar, EAN-13, EAN-8, UPC-A, UPC-E, MSI, QR Code, Data Matrix, PDF417, Aztec) and Zebra ZPL II labels to PDF on top of EgoPDF.Generator and ZXing.Net. Targets net8.0 and net9.0. |
|
|
EgoPDF.Markdown
Render Markdown documents to PDF on top of EgoPDF.Generator and Markdig. Phase-1 happy path: headings (H1-H6), paragraphs with inline emphasis (bold / italic / code / links / autolinks), bullet and ordered lists (nested), fenced code blocks with background, horizontal rules and local images. Targets net8.0 and net9.0. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.1 | 138 | 6/10/2026 |
| 2.3.0 | 149 | 6/7/2026 |
| 2.2.1 | 129 | 6/6/2026 |
| 2.2.0 | 121 | 6/2/2026 |
| 2.1.0 | 112 | 5/22/2026 |
| 2.0.107 | 4,101 | 3/13/2025 |
| 2.0.106 | 224 | 3/12/2025 |
| 2.0.105 | 2,943 | 4/3/2024 |
| 2.0.104 | 186 | 4/2/2024 |
| 1.0.70 | 6,936 | 7/21/2020 |
| 1.0.69 | 1,213 | 7/21/2020 |
| 1.0.68 | 1,232 | 7/21/2020 |
| 1.0.66 | 1,189 | 7/20/2020 |
| 1.0.65 | 1,213 | 7/19/2020 |
| 1.0.64 | 1,271 | 7/19/2020 |
| 1.0.62 | 1,315 | 11/20/2019 |
| 1.0.60 | 1,261 | 11/6/2019 |
| 1.0.59 | 1,281 | 8/30/2019 |
| 1.0.58 | 1,418 | 7/26/2019 |
| 1.0.57 | 1,322 | 7/26/2019 |
2.2.1: three bug fixes, no API changes. (1) FPdf("file.pdf") now sets AutoFlush=true on the file-backed buffer; previously the trailing xref / trailer / %%EOF stayed in the StreamWriter's internal buffer and a caller reading Buffer.BaseStream after Close() got a truncated PDF ending at the last endobj. (2) FontScale.Default / DoubleHeight / DoubleWidth become read-only properties that synthesise a fresh instance per access; previously they were mutable static fields and ZPL field-scaling writes (FieldDefinition.ScaleX) leaked into every FPdf constructed afterwards in the same process. (3) Sample3 footer uses 8 pt (matches FPDF tutorial 3) instead of the 15 pt typo. 2.2.0 added layout primitives (Row / Stack / Panel + Rect + PanelStyle) and scope helpers (PushState / PushPos); see release notes for that version.