The development of PDFsharp started with .NET 1.1. PDFsharp used the graphics functions of GDI+, a graphics library from Microsoft encapsulated in the System.Drawing namespace
class of PDFsharp has functions for drawing graphics and text very similar to the System.Drawing.Graphics class
. The advantage of this approach is that PDFsharp was able to draw text and graphics not only in PDF documents, but on WinForms windows and printers too. This allows creating preview functionality in WinForms. See Preview sample
After Microsoft released WPF a second build of PDFsharp was developed that substitutes the GDI+ code with WPF code. The two builds co-exist using conditional compilation while sharing large parts of the source code.
More builds were added to support Silverlight and WinRT.
The PDF Core build is the latest build. When completed, it will use neither GDI+ nor WPF. Then the PDF Core build will be useful for Mono and other platform that are not using Windows.
We include solutions for Visual Studio 2012 and Visual Studio 2013 and Visual Studio 2010 should be able to open the solutions, too.
PDF Core Build
The PDFcore Build is still incomplete. Once completed it will not use GDI+ anymore, allowing it to be used anywhere without relying on external libraries. As of PDFsharp 1.50 beta it still uses GDI+ for some image operations.
The GDI+ build of PDFsharp still compiles with .NET 2.0 and C# 2. It can be used in WinForms and Web applications, as well as in WPF applications. Most PDFsharp samples are available for the GDI+ build. .NET 1.1 is not supported anymore.
The WPF build compiles with .NET 3.5 but still uses C# 2 features only. This build is good for native WPF applications. Nearly all PDFsharp samples are also available for the WPF build. The sample code itself is shared between both builds.
The Hybrid build compiles both the GDI+ code and the WPF code in one single project. This is not useful for anything but testing. The Hybrid build e. g. creates each font twice, one GDI+ font and one WPF font, and compares the results of both technologies while it is running. If a difference is detected, there must be a bug in the implementation of either the GDI+ or the WPF build. See XGraphicsLab-WPF
as a hybrid test application.Note:
The Hybrid build must not be used in real world projects.
The WinRT Build is incomplete and under construction. Use it at your own risk.
The Silverlight Build is incomplete and under construction. Use it at your own risk. As of PDFsharp 1.50, image handling is incomplete and inefficient.
Follow PDFsharp on Twitter
and receive information about new versions, new beta versions, updates, breaking news.