EgoPDF.Generator
2.3.1
dotnet add package EgoPDF.Generator --version 2.3.1
NuGet\Install-Package EgoPDF.Generator -Version 2.3.1
<PackageReference Include="EgoPDF.Generator" Version="2.3.1" />
<PackageVersion Include="EgoPDF.Generator" Version="2.3.1" />
<PackageReference Include="EgoPDF.Generator" />
paket add EgoPDF.Generator --version 2.3.1
#r "nuget: EgoPDF.Generator, 2.3.1"
#:package EgoPDF.Generator@2.3.1
#addin nuget:?package=EgoPDF.Generator&version=2.3.1
#tool nuget:?package=EgoPDF.Generator&version=2.3.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 | 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,933 | 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.3.1: tiny ^FO + R-rotated text padding tweak in WriteRotatedTextZpl. When the caller passes useTopLeftBboxAnchor=true (Barcodes engine's ^FO ^A?R path), the baseline column now sits ~30% of the font ascent to the right of the FO point instead of flush against it. Matches Labelary's spacing on the SEUR 1485 portrait label, where the previous baseline-on-FO was visibly cramped against the rotated ascender of letters like P / W / A. ^FT-anchored fields (useTopLeftBboxAnchor=false) keep the unpadded baseline so rotated-bar caption helpers stay in the column their caller picked. 2.3.0: five fixes that stop Acrobat from offering to "save the repaired file" every time you open one of our PDFs. (1) /CreationDate was rendered with the PHP date format "YmdHis" copy-pasted into DateTime.ToString, which produced unparseable values like "D:Y4721i12"; now emits a spec-compliant "D:yyyyMMddHHmmss+OH'mm'" stamp (PDF 1.7 §7.9.4). (2) After "%PDF-1.3" we now emit the recommended comment line with four 0x80+ bytes so the file is unambiguously binary (§7.5.2). (3) The trailer gains a /ID [<hash><hash>] entry (§14.4) -- Acrobat treats trailers without /ID as needing repair. (4) Empty "/XObject <<>>" dictionaries in Resources are now omitted when the page has no XObjects. (5) Xref entries are zero-padded ("0000000211 00000 n ") instead of space-padded, matching §7.5.4 verbatim. 2.2.1 had three earlier bug fixes (AutoFlush on the file-backed constructor, FontScale.Default mutation leak, Sample3 footer font size).