EgoPDF.Generator
2.2.0
See the version list below for details.
dotnet add package EgoPDF.Generator --version 2.2.0
NuGet\Install-Package EgoPDF.Generator -Version 2.2.0
<PackageReference Include="EgoPDF.Generator" Version="2.2.0" />
<PackageVersion Include="EgoPDF.Generator" Version="2.2.0" />
<PackageReference Include="EgoPDF.Generator" />
paket add EgoPDF.Generator --version 2.2.0
#r "nuget: EgoPDF.Generator, 2.2.0"
#:package EgoPDF.Generator@2.2.0
#addin nuget:?package=EgoPDF.Generator&version=2.2.0
#tool nuget:?package=EgoPDF.Generator&version=2.2.0
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 | 129 | 6/10/2026 |
| 2.3.0 | 145 | 6/7/2026 |
| 2.2.1 | 126 | 6/6/2026 |
| 2.2.0 | 118 | 6/2/2026 |
| 2.1.0 | 110 | 5/22/2026 |
| 2.0.107 | 3,966 | 3/13/2025 |
| 2.0.106 | 224 | 3/12/2025 |
| 2.0.105 | 2,940 | 4/3/2024 |
| 2.0.104 | 185 | 4/2/2024 |
| 1.0.70 | 6,933 | 7/21/2020 |
| 1.0.69 | 1,211 | 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,270 | 7/19/2020 |
| 1.0.62 | 1,313 | 11/20/2019 |
| 1.0.60 | 1,260 | 11/6/2019 |
| 1.0.59 | 1,280 | 8/30/2019 |
| 1.0.58 | 1,418 | 7/26/2019 |
| 1.0.57 | 1,322 | 7/26/2019 |
2.2.0: layout primitives and scope helpers. New Rect value type plus FPdf.Row / Stack / Panel for composing pages without (x + width + gap) arithmetic. PanelStyle records capture frame + title looks as reusable data. PushState / PushPos return IDisposable scopes that auto-restore font, colour, line-width and cursor state. Bounds() returns the printable area as a Rect. Bug fixes: GetStringWidth falls back to the "A" glyph width for missing characters instead of throwing KeyNotFoundException; GoBack(GoBackMode) now honours the X / Y / Both selector. Fully additive over 2.1.0.