History of PDFsharp &
MigraDoc Foundation project
Here are the general news and improvements of the PDFsharp & MigraDoc Foundation project.
The source code on GitHub is in a new repository called PDFsharp
. The former repository with the same name was renamed to PDFsharp-1.5
.
What's new in version 6.1
Notes on preview version 6.1.0
Version 6.1.0 adds multi-targeting, supporting .NET 6 and .NET Standard 2.0 for the Core build and .NET 6 and .NET 4.7.2 for the GDI+ and WPF builds.
We are still working on the default FontResolver for the Core build. With version 6.1.0 it is highly recommended to supply a FontResolver for the Core build.
You can try SegoeUiFontResolver
or SegoeWpFontResolver
that are included with this release while evaluating PDFsharp. Note that these FontResolvers are meant to get you started. For applications that use the Core build you should include an own implementation of IFontResolver that fulfills your requirements.
Feel free to use the code of those supplied FontResolvers to create your own FontResolver according to your requirements.
The assemblies are now strong-named (*.snk
) again because version 6.1 supports .NET Standard 2.0 and .NET Framework 4.7.2. See Strong Name Signing for further information why.
Notes on version 6.1.0 Preview 3
The Core build now uses a built-in font resolver that will support basic fonts like Arial and Times New Roman when run under Windows or WSL2. Surrogate fonts will be used when run under Ubuntu Linux, but font support may vary depending on the Linux distribution. No fonts will be found when running under MacOS.
When distributing applications that use the Core build, make sure to include a font resolver that handles all font requests your application depends on, so it can run on any computer that supports the Core build, including MacOS and others.
What's new in version 6.0
Notes on stable release version 6.0.0
We are still working on the default FontResolver for the Core build. With version 6.0.0 it is highly recommended to supply a FontResolver for the Core build.
You can try NewFontResolver
, SegoeUiFontResolver
, or SegoeWpFontResolver
that are included with this release. Note that NewFontResolver
was renamed to SnippetsFontResolver
with version 6.1.0 Preview 1. Note that SnippetsFontResolver
is no longer available as of version 6.1.0 Preview 3.
Feel free to use the code of those supplied FontResolver to create your own FontResolver according to your requirements.
Ported to .NET 6
- PDFsharp now based on .NET 6. So it runs where .NET 6 runs including Windows, Linux, and Mac.
- PDFsharp 1.5 based on .NET Framework will keep available on GitHub but will not be maintained anymore.
- PDFsharp packages come in three flavors:
- The Core version that runs everywhere where .NET runs.
- The GDI+ build that uses GDI+ (System.Drawing) and runs under Windows only.
- The WPF build that uses Windows Presentation Foundation and runs under Windows only.
- Versioning switched to semantic versioning for the NuGet packages. The package version is now aligned with the .NET version.
- Outdated concepts removed:
- The assemblies are not strong-named (
*.snk
) anymore. See Strong Name Signing for further information why.
- The assemblies are not strong-named (
Differences between Core build and the other builds
The Core build does not depend on Windows-specific assemblies. This allows the Core build to be used under other platforms like Linux and macOS, but leads to some differences.
- Font handling: Both the GDI+ build and the WPF build allow you to use all TrueType fonts installed under Windows without writing any code. The portability of the Core build requires a FontResolver that supplies the font data. You can try
SnippetsFontResolver
,SegoeUiFontResolver
, orSegoeWpFontResolver
that are included with this release. - Image formats: The Core build supports Windows BMP files, Portable Network Graphic PNG files, and JPEG files. We recommend to convert other images to the Windows BMP format. Images will be compressed when they are added to PDF. While conversion from e.g. GIF to BMP leads to larger image files, the resulting PDF files should have about the same size.
- Font outlines: The GDI+ and WPF build can convert font glyphs to graphical paths, allowing them to be used with graphical operations. One use are large texts with special effects, e.g. for watermarks. This is not yet possible with the Core build. Color can still be applied to text, but some advanced styles cannot yet be achieved.
Code review and update
The source code was revised. Here are the most important changes.
- Old code for Silverlight, WRT, Windows Phone was mostly removed.
- Code uses new C# features until C# 11
- Code was reworked for nullable value types. All projects are now 'nullable' enabled.
- The attribute InternalsVisibleTo is not required anymore, exceptions may be unit tests.
Benchmark results
We achieved speed improvements in many areas. See MigraDoc history for details: MigraDoc benchmark results
References
For changes in PDFsharp see History PDFsharp
For changes in MigraDoc see History MigraDoc