PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 6:06 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Oct 23, 2018 1:03 pm 
Offline

Joined: Tue Oct 23, 2018 12:48 pm
Posts: 1
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 23, 2018 1:39 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!

The official empira packages are for Windows and Silverlight only. We do not have special packages for Mono or Android.
But AIUI the regular packages can be used with Mono. I have no experience with Android.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 131 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group