PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Dec 11, 2019 5:55 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: PDfSharp and Unity
PostPosted: Mon Aug 12, 2019 2:28 pm 
Offline

Joined: Mon Aug 12, 2019 2:07 pm
Posts: 2
Hello everybody,

I have an issue on a specific usage and I hope someone will help me. :)
I try to fill AcroForm on iOS app create with Unity (I know, it's weird, but I need Unity for AR development).

In Unity Editor, everything work!
The compilation on iOS work fine and no error with PDFSharp library.
But in the app, when I try to read my original PDF I have this issue:
Code:
System.InvalidCastException: Unable to cast object of type 'PDFDictionary' to type 'PdfDocumentInformation'.
at PDFSharp.Pdf.Advanced.PdfTrailer.get_info () ...
at PdfSharp.Pdf.PdfDocument.get_info () ..
at PdfSharp.Pdf.IO.PdfReader.Open(System.IO.Stream stream, System.String password, PDFSharp.Pdf.IO.PdfDocumentOpenMode openmode, PdfSharp.Pdf.IO.PdfPasswordProvider passwordProvider) ...
at PdfSharp.Pdf.IO.PdfReader.Open(System.String path, System.String password, PDFSharp.Pdf.IO.PdfDocumentOpenMode openmode, PdfSharp.Pdf.IO.PdfPasswordProvider Provider) ...


I try to read the pdf with PdfDocumentOpenMode.Modify.

Someone have an idea? Thanks!

Best regards,
Alexis


Top
 Profile  
Reply with quote  
 Post subject: Re: PDfSharp and Unity
PostPosted: Wed Aug 14, 2019 8:37 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3012
Location: Cologne, Germany
Hi!
AlexisDev wrote:
Someone have an idea?
Use the issue submission template to replicate the issue under Windows with the latest stable version.

See also:
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: PDfSharp and Unity
PostPosted: Wed Aug 14, 2019 3:04 pm 
Offline

Joined: Mon Aug 12, 2019 2:07 pm
Posts: 2
Hello,

I'm using: PDFSharp 1.50.5147 (Nuget package here)

Me code:
Code:
string path = "Devis_Client_Vierge.pdf";
string dest = "Devis-Test.pdf";

PdfDocument document = PdfReader.Open(path, PdfDocumentOpenMode.Modify);

document.Save(dest);
document.Close();


I found the problem come from IL2CPP scripting backend (not from PDFSharp library directely).
If I use Mono scripting backend when I build me project, everything work. But when I use IL2CPP (And I need it for iOS app...), the issue appear.

I will investigate in that direction!

Sorry for your time.

Best regards,
Alexis


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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