PDFsharp has some options you can use to control compression.
You can activate some options to generate smaller PDF files – at the price of longer creation times. Continue reading PDFsharp/MigraDoc: Get Smaller PDF Files by Tweaking Compression Options
EZFontResolver implements the IFontResolver interface that PDFsharp uses.
In your program, you simply call the AddFont method of EZFontResolver. You simply pass the filename of your font or a byte array containing the font data. Continue reading EZFontResolver: a generic font resolver for PDFsharp and MigraDoc
I revisited my VB.NET sample for MigraDoc, but this time achieving the same and more using my new MigraDoc Made EZR library. Achieve the same document, but with fewer lines of code. And in my humble opinion those lines are even easier to read (and to write). Continue reading MigraDoc Made EZR: VB.NET Sample that creates PDF file
Earlier versions of MigraDoc up to version 1.32 included the class MigraDocPrintDocument that allows MigraDoc to print directly.
This class can also be used with MigraDoc 1.50 beta 2. Continue reading Printing with MigraDoc 1.50 beta 2
Using MigraDoc was always easy, of course.
Currently I am working on a library that makes using MigraDoc even easier. Working title is “MigraDoc Made EZR”. In this post I show you some examples. Continue reading Using MigraDoc was never easier – “MigraDoc Made EZR”
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
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
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
Let’s face it: as of today it sometimes takes a few seconds to create a PDF for a MigraDoc document, especially if the document contains many tables.
A nice progress bar will prevent users from pressing Ctrl+Alt+Del to kill a presumably hung application. I’ll show you how this can be done. Continue reading MigraDoc: Show Progress While Rendering a Document
PDFsharp includes an XTextFormatter class that allows to draw text with line breaks.
A frequently requested feature: how to measure the height of the text before drawing it? I decided to add this measuring functionality. I found it was more difficult than I expected. Continue reading PDFsharp: Improving the XTextFormatter class: Measuring the height of the text