pdfsharpcore: Can’t access MigraDoc classes

2k Views Asked by At

I am working on a .NET Core Project (Version 2.401) and have implemented a XLSX to PDF converter with PDFsharp and MigraDoc. After some tests I recognised that these packages are not compatible with .NET Core.

So I switched to the .NET Core implementation PdfSharpCore (https://github.com/ststeiger/PdfSharpCore), which looks very similar to the original. PdfSharpCore is also a port of MigraDoc. You can find classes like "Document".

My issue is, that I can’t access these classes. For example:

using MigraDocCore.DocumentObjectModel;
using MigraDocCore.DocumentObjectModel.Rendering;
using PdfSharpCore.Drawing;
using PdfSharpCore.Fonts;
using PdfSharpCore.Pdf;
using System.Reflection;


namespace PDFTEST
{
  public class PDFShareCoreTest
  {
    private Document Document { get; set; }
  }
}

I can’t access the class Document. I also tried IntelliSense to find that class but no chance.

I also found an example on GitHub where someone is using all the classes that I requested from MigraDoc:

https://github.com/groege/PdfSharpCore/blob/master/Example/Program.cs

Anyone an idea what I am doing wrong?

1

There are 1 best solutions below

3
On BEST ANSWER

Finally I found a library on nuget which was perfect to use my old Code and has the compatibility with .Net Core

I use now:

https://www.nuget.org/packages/MigraDoc.DocumentObjectModel.Core/1.0.0/ https://www.nuget.org/packages/MigraDoc.Rendering.Core/1.0.0/