PDFsharp & MigraDoc Foundation

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

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 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: 3095
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  
 Post subject: Re: PDfSharp and Unity
PostPosted: Thu Oct 29, 2020 12:59 pm 
Offline

Joined: Mon Oct 26, 2020 3:00 pm
Posts: 3
Same here. Also happens when importing a PDF file and compiling with IL2CPP in Unity (Mono works fine).


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

All times are UTC


Who is online

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