GithubHelp home page GithubHelp logo

methuselah96 / pdfsharpcore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ststeiger/pdfsharpcore

0.0 1.0 0.0 2.51 MB

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

License: Other

Smalltalk 3.97% C# 96.02% PowerShell 0.01% Batchfile 0.01%

pdfsharpcore's Introduction

PdfSharpCore

NuGet Version CI codecov.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.

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 file for more info.

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

  • SixLabors.ImageSharp and SixLabors.Fonts

pdfsharpcore's People

Contributors

ststeiger avatar startnow65 avatar jafin avatar marv51 avatar tinokrueger avatar devbar avatar packdat avatar michelmichels avatar baskren avatar mishun avatar foobar2016 avatar ascott18 avatar officedevunofficial avatar schtritoff avatar sappharad avatar jetski5822 avatar thhhza avatar pamapa avatar leo2d avatar kerams avatar animalcaretechnologies avatar hippasus avatar ashishjagdale84 avatar artehe avatar schtho avatar sanglanun avatar saikatguha avatar nils-a avatar mitchcapper avatar parknert avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.