HAve been trying to utilize Migradoc and pdfSharp in my unity android app to create .pdf reports. I have imported :
PDFsharp-MigraDoc.1.50.4845-RC2a into my project but the call:
Code:
MigraDoc.Rendering.PdfDocumentRenderer docrend = new MigraDoc.Rendering.PdfDocumentRenderer(true);
docrend.Document = doc;
docrend.RenderDocument();//this line throws a: Object reference not set to an instance of an object at PdfSharp.Pdf.PdfPage.Initialize ()
on
android throws an exception,
aldo it works great on windowsplatform.
Am I doing something wrong? Have I imported the wrong package? What should I do to make this work?
Android studio logcat reports:
NullReferenceException: Object reference not set to an instance of an object
at PdfSharp.Pdf.PdfPage.Initialize () [0x00000] in <filename unknown>:0
at PdfSharp.Pdf.PdfPage..ctor () [0x00000] in <filename unknown>:0
at PdfSharp.Pdf.PdfPages.Add () [0x00000] in <filename unknown>:0
at PdfSharp.Pdf.PdfDocument.AddPage () [0x00000] in <filename unknown>:0
at PdfSharp.Drawing.XGraphics.CreateMeasureContext (XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) [0x00000] in <filename unknown>:0
at MigraDoc.Rendering.DocumentRenderer.PrepareDocument () [0x00000] in <filename unknown>:0
at MigraDoc.Rendering.PdfDocumentRenderer.PrepareDocumentRenderer (Boolean prepareCompletely) [0x00000] in <filename unknown>:0
at MigraDoc.Rendering.PdfDocumentRenderer.PrepareRenderPages () [0x00000] in <filename unknown>:0
at MigraDoc.Rendering.PdfDocumentRenderer.RenderDocument () [0x00000] in <filename unknown>:0