Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ststeiger/pdfsharpcore
Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
https://github.com/ststeiger/pdfsharpcore
alpha csharp imagesharp netcore2 netstandard20 pdf pdfsharp xamarin
Last synced: 5 days ago
JSON representation
Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
- Host: GitHub
- URL: https://github.com/ststeiger/pdfsharpcore
- Owner: ststeiger
- License: other
- Created: 2017-04-18T12:55:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-25T15:41:13.000Z (6 months ago)
- Last Synced: 2025-01-01T09:15:26.353Z (21 days ago)
- Topics: alpha, csharp, imagesharp, netcore2, netstandard20, pdf, pdfsharp, xamarin
- Language: C#
- Homepage:
- Size: 2.16 MB
- Stars: 1,083
- Watchers: 38
- Forks: 235
- Open Issues: 182
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PdfSharpCore
[![NuGet Version](https://img.shields.io/nuget/v/PdfSharpCore.svg)](https://www.nuget.org/packages/PdfSharpCore/)
[![CI](https://github.com/ststeiger/PdfSharpCore/actions/workflows/build.yml/badge.svg)](https://github.com/ststeiger/PdfSharpCore/actions/workflows/build.yml)
[![codecov.io](https://codecov.io/github/ststeiger/PdfSharpCore/coverage.svg?branch=master)](https://codecov.io/github/ststeiger/PdfSharpCore?branch=master)**PdfSharpCore** is a partial port of [PdfSharp.Xamarin](https://github.com/roceh/PdfSharp.Xamarin/) for .NET Standard.
Additionally MigraDoc has been ported as well (from version 1.32).
Image support has been implemented with [SixLabors.ImageSharp](https://github.com/JimBobSquarePants/ImageSharp/) and Fonts support with [SixLabors.Fonts](https://github.com/SixLabors/Fonts).## Table of Contents
- [Documentation](docs/index.md)
- [Example](#example)
- [Contributing](#contributing)
- [License](#license)## 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.```csharp
using PdfSharpCore.Drawing;
using PdfSharpCore.Fonts;
using PdfSharpCore.Pdf;
using PdfSharpCore.Utils;GlobalFontSettings.FontResolver = new FontResolver();
var document = new PdfDocument();
var page = document.AddPage();var gfx = XGraphics.FromPdfPage(page);
var font = new XFont("Arial", 20, XFontStyle.Bold);var textColor = XBrushes.Black;
var layout = new XRect(20, 20, page.Width, page.Height);
var format = 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](LICENCE.md) file for more info.
PdfSharpCore relies on the following projects, that are not under the MIT license:
* *SixLabors.ImageSharp* and *SixLabors.Fonts*
* SixLabors.ImageSharp and SixLabors.Fonts, libraries which PdfSharpCore relies upon, are licensed under Apache 2.0 when distributed as part of PdfSharpCore. The SixLabors.ImageSharp license covers all other usage, see https://github.com/SixLabors/ImageSharp/blob/master/LICENSE