Skip to content

Repository files navigation

PdfSharpCore

NuGet VersionCIcodecov.io

PdfSharpCore is a partial port of PdfSharp.Xamarin for .NET Standard. Additionally MigraDoc has been ported as well (from version 1.32). Image support has been implemented with SixLabors.ImageSharp and Fonts support with SixLabors.Fonts.

Table of Contents

Example

The following code snippet creates a simple PDF-file with the text 'Hello World!'. The code is written for a .NET 6 console app with top level statements.

usingPdfSharpCore.Drawing;usingPdfSharpCore.Fonts;usingPdfSharpCore.Pdf;usingPdfSharpCore.Utils;GlobalFontSettings.FontResolver=newFontResolver();vardocument=newPdfDocument();varpage=document.AddPage();vargfx=XGraphics.FromPdfPage(page);varfont=newXFont("Arial",20,XFontStyle.Bold);vartextColor=XBrushes.Black;varlayout=newXRect(20,20,page.Width,page.Height);varformat=XStringFormats.Center;gfx.DrawString("Hello World!",font,textColor,layout,format);document.Save("helloworld.pdf");

Contributing

We appreciate feedback and contribution to this repo!

License

This software is released under the MIT License. See the LICENSE file for more info.

PdfSharpCore relies on the following projects, that are not under the MIT license:

  • SixLabors.ImageSharp and SixLabors.Fonts

About

Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)

Topics

Resources

Stars

1.2k stars

Watchers

34 watching

Forks

Releases

Packages

Used by

Contributors

Languages