EgoPDF.Generator 2.2.0

There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EgoPDF.Generator" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EgoPDF.Generator" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="EgoPDF.Generator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EgoPDF.Generator --version 2.2.0
                    
#r "nuget: EgoPDF.Generator, 2.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EgoPDF.Generator@2.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EgoPDF.Generator&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=EgoPDF.Generator&version=2.2.0
                    
Install as a Cake Tool

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 LoadFont a .ttf path.
  • Embedded fonts emit valid PDF descriptors (PostScript-safe BaseFont names, real FontBBox, non-zero StemV, 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

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.