READ ME Version 6.2
What’s new
See General for general innovations
See PDFsharp for PDFsharp-specific information
See MigraDoc for MigraDoc-specific information
Prerequisites
What you need to use PDFsharp.
.NET 6, .NET 8, .NET Standard 2.0, and .NET 4.6.2 NuGet packages
For your .NET (former .NET Core) projects we provide NuGet packages for .NET 6 or higher. For WinForms (GDI+) or WPF projects under .NET we provide packages for .NET 6 for Windows.
For your .NET Framework projects we provide packages for .NET Standard 2.0. For WinForms (GDI+) or WPF projects, we provide packages for .NET Framework 4.6.2.Latest SDK for building PDFsharp solutions
Use the latest version of the SDK (.NET 8.0.100) to build the PDFsharp solution. This is because we use C# features from versions higher than C# 7.
Breaking changes
There are breaking changes in PDFsharp 6.2 Preview 2 relative to 6.2.0 Preview 1 and earlier versions.
- CoreBuildFontResolver was removed from PDFsharp, but code is still available in the PDFsharp.Samples repository. PDFsharp Core applications now must set a font resolver even when running under Windows.
- PlatformFontResolver now has different behavior for Core build. Read more
- Handling of page-orientation has changed. Most programs are not affected by this change, but apps that use the Ledger page format or similar may require updates.
More about breaking changes in PDFsharp
More about breaking changes in MigraDoc
Assets are removed from repositories
PDFsharp uses a lot of assets like files for images, fonts, or PDFs.
Starting with PDFsharp 6 these assets are not part of the repositories anymore.
Instead, they are available for download from https://assets.pdfsharp.com
.
Before you can compile or run projects of a solution go to the dev
folder in the solution root and run download-assets.ps1
once.
This script downloads the assets required by the solution from the web into the assets
folder.
Compile PDFsharp solutions
When you clone a repository like PDFsharp or PDFsharp.Samples from GitHub and download the assets once, it should compile immediately with Visual Studio or dotnet build
.
Because we use GitVersion to create the semantic version number from a git tag and the current branch name, there may be issues.
- The build may fail because GitVersion does not find a valid commit to calculate the version number. See Note on using the ZIP file from GitHub.
There may be other reasons why the build fails.
- A C# file may contain non-ASCII characters and have neither BOM nor UTF-8 encoding. This can happen because our German Windows machines may encode such a file with Western European Codepage 1252 and such a file cannot be opened correctly on e.g. a Chinese Windows machine. Maybe this issue is already fixed in Visual Studio.
Let us know when a solution does not compile immediately.
Running tests
Run examples under Linux
The PDFsharp solution builds completely under Linux. But obviously only the PDFsharp core examples can be executed. We test it using WSL2 with Ubuntu 20.04 LTS.