
PDFsharp in detail
What is PDFsharp?
PDFsharp is the open-source .NET library that easily creates and processes PDF documents.
You can create a PDF document from code, add pages, and draw graphics, text, and images using a simple drawing context.
- You can also open existing PDF files, remove, add or modify pages, or concatenate files
- PDFsharp is published under MIT license and free for use with all kinds of projects
- The library is compatible with .NET and .NET Framework
For more technical details see
PDFsharp introduction in the Technical reference.
Key features
- Create PDF documents from code
- Modify, merge, and split existing PDF files
- Easy to use PDF object model to compose documents
- Draws lines, curves, shapes, paths, and more
- Draws text using open type fonts
- Draws images from various formats (JPEG, PNG, …)
- Draws PDF content as form (Form XObjects)
- RGB, CMYK and Gray-Scale color spaces
PDF-specific features
- PDF/A for archiving
- PDF/UA for universal accessibility
- PDF document encryption
- PDF document with digital signature
Framework-specific features
- Core build for .NET for all platforms including Windows, Linux, Mac, …
- Core build for .NET Standard for older projects
- PDFsharp provides an additional build under Windows for GDI+ (WinForms), taking advantage of the font and image handling capabilities of GDI+ and Windows
- PDFsharp provides an additional build under Windows for WPF (Windows Presentation Foundation), taking advantage of the font and image handling capabilities of WPF and Windows
Frequently asked questions
Why should I use PDFsharp?
PDFsharp is a mature free and open-source software published under the permissible MIT license.
- Runs on all platforms where .NET or .NET Framework is available including Linux, Docker, Blazor, etc.
- Well-engineered, millions of downloads
- Create PDF on any platform, operating system or device
- Will stay free and open source
On which platforms does PDFsharp run in detail?
PDFsharp can be used with all your .NET and .NET Framework projects.
There are 3 build “flavors” for both .NET and .NET Framework.
The PDFsharp Core build compiled for .NET runs on Windows, Mac, Linux, Docker, Blazor, mobile devices, etc., i.e. it runs everywhere .NET is available.
The PDFsharp Core build compiled for .NET Framework runs on Windows and any platform where .NET Standard 2.0 is supported.
Besides PDFsharp Core, which has no dependencies on Windows, there are two additional builds specialized for Windows: PDFsharp-WPF and PDFsharp-GDI. Both builds are available for both .NET and .NET Framework.
PDFsharp-WPF provides additional functionality for projects based on Windows Presentation Foundation. PDFsharp-GDI provides additional functionality for projects based on WinForms. The main benefits are that you can use GDI+/WPF-specific features for font selection and bitmap image processing. Additionally, both builds provide a preview control.
Is PDFsharp based on other libraries?
No, PDFsharp library is completely self-contained. Beside .NET / .NET Framework we only use some Microsoft extension libraries for e.g. logging. PDFsharp Core has no dependencies on Windows.
PDFsharp includes a free PNG library for adding PNG images to PDF documents.
For cryptography we provide sample code based on Microsoft’s System.Security.Cryptography and BouncyCastle.Cryptography, but PDFsharp does not depend on these libraries.
For development and building we use xUnit for unit testing and GitVersion for generating semantic version information.