Search code examples
c#.netpdfsharpmigradoc

How to reference MigraDoc in a C# project?


Sorry for the stupid question, but how do I reference MigraDoc? I'm trying like this but no luck so far:

using PDFsharp.MigraDoc;

I'm in a .NET project, this is the reference line in the *.sln

<PackageReference Include="PdfSharp.MigraDoc" Version="2.0.1" />


Solution

  • First, get an official version like this one:
    https://www.nuget.org/packages/PDFsharp-MigraDoc-WPF/1.50.4845-RC2a

    Version 2.0.1 is not the official MigraDoc version.

    The start with using statements as shown here:

    using MigraDoc.DocumentObjectModel;
    using MigraDoc.DocumentObjectModel.Tables;
    

    Sample source code can be found here:
    https://github.com/empira/MigraDoc-samples https://sourceforge.net/projects/pdfsharp/files/pdfsharp/PDFsharp%201.50%20%28beta%203%29/