XTextFormatter revisited: XTextFormatterEx2 for PDFsharp 1.50 beta 2

In an earlier post I described how to improve the XTextFormatter class for PDFsharp 1.32. The problem with that old version: the modified version of XTextFormatter has to be in an assembly with access to the internals of PDFsharp, so you have to compile PDFsharp in order to have an enhanced formatter.

With PDFsharp 1.50 beta things are simpler: all the XTextFormatter class needs is public now and you can use an enhanced version of XTextFormatter even if you are working with the NuGet package of PDFsharp.

My XTextFormatterEx2 has the measuring functionality from XTextFormatterEx. Additionally it allows to control the line spacing. Continue reading XTextFormatter revisited: XTextFormatterEx2 for PDFsharp 1.50 beta 2

Using private fonts with PDFsharp 1.50 beta 2/3 or MigraDoc

Note: The FontResolver interface has changed between PDFsharp 1.50 beta 1 and PDFsharp 1.50 beta 2. This post describes the new solution for PDFsharp 1.50 beta 2 and later versions.

PDFsharp 1.50 implements a new mechanism for private fonts (fonts that are not installed on the system). You simply implement IFontResolver and assign this to a global property:

// That's all it takes to register your own fontresolver
GlobalFontSettings.FontResolver = new DemoFontResolver();

The interesting part is IFontResolver and how you implement it.
Continue reading Using private fonts with PDFsharp 1.50 beta 2/3 or MigraDoc

MigraDoc: Visual Basic .NET Sample

Not many Visual Basic samples come with PDFsharp and MigraDoc. As the name PDFsharp implies, those libraries were developed by C# fans.
Here is a Visual Basic sample for MigraDoc. It should be enough to help you understand the C# samples for MigraDoc and translate them to Visual Basic when needed. Continue reading MigraDoc: Visual Basic .NET Sample