Introduction to PDFsharp &
MigraDoc Foundation
Version 6.1.0
In this article
This article gives you a brief introduction what PDFsharp and MigraDoc are.
What are PDFsharp and MigraDoc?
MigraDoc is a document generator. It supports almost anything you find in any good word processor. You just add paragraphs, tables, charts, arrange all this in sections, use bookmarks to create links, tables of contents, indexes, etc. MigraDoc will do the layout creating page breaks as needed. MigraDoc will create PDF or RTF documents.
PDFsharp is a .NET library for processing PDF files. You create PDF pages using drawing routines known from GDI+. Almost anything that can be done with GDI+ will also work with PDFsharp. Only basic text layout is supported by PDFsharp, and page breaks are not created automatically. The same drawing routines can be used for screen, PDF, or meta files.
Use PDFsharp or MigraDoc?
Use MigraDoc if you need documents as PDF and RTF files and you want to compose your document by creating objects like Paragraph and Table. When your document object model is ready, MigraDoc renders it to PDF and calculates page breaks, headers and footers, page numbers, etc.
Use PDFsharp if you want to create PDF files with low level control of graphic and text. You also can use PDFsharp to modify existing documents. MigraDoc uses PDFsharp to render a MigraDoc document to PDF.
Mixing PDFsharp and MigraDoc
If MigraDoc does almost anything you need, then you can use MigraDoc to create PDF files and post-process them with PDFsharp to add some extra features. Soon you’ll be able to use placeholders in MigraDoc and later on use PDFsharp to draw these placeholders.
Or use PDFsharp to create the document but use MigraDoc to create individual pages. This could be the best choice if your application uses lots of graphics, but also needs some layouted text.
This is a site that contains information about PDFsharp 6 and higher. A general overview what PDFsharp and MigraDoc are can be found on the version 1.x web site.