Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by SirMabrouk · Aug 12, 2019 at 04:35 PM · button trigger eventslibrarylibraries

Integrating IronPdf crashes unity

I worked with itextpdf which worked well with unity, but i had to switch to IronPdf as i needed to work with arabic, which was a problem because it needed an itextpdf add-on that wasn't free.

Anyway IronPdf seemed to work well when i tried it on a console app, but unity freezes as soon as i call the function that has the code.

 using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.IO;
 using UnityEngine;
 using UnityEngine.UI;
 using TMPro;
 using IronPdf;
 
 public class ConvertPDF : MonoBehaviour
 {
     public TextMeshProUGUI txt;
     
 
     public void Nothing()
     {
         Debug.Log("Nothing");
     }
     
     public void Html2PDF()
     {
         Debug.Break();
         string msg = "";
         try
         {
             
             IronPdf.HtmlToPdf Renderer = new IronPdf.HtmlToPdf();
             IronPdf.PdfDocument PDF = Renderer.RenderHTMLFileAsPdf("input.html");
             string OutputPath = "output.pdf";
             PDF.SaveAs(OutputPath);
             msg = "Generated to " + OutputPath;
         }
         catch (Exception e)
         {
             msg = e.Message;
         }
         txt.text = msg;
         Debug.Log(msg);
     }
 }

I call this function when a button is pressed and unity crashes even though i added the dll of the library to unity the same way i did with itextpdf.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hexagonius · Oct 17, 2019 at 07:53 AM 0
Share

And what's the error message? Have read through the player log? https://docs.unity3d.com/$$anonymous$$anual/LogFiles.html

avatar image rubenmueller · Oct 17, 2019 at 08:31 AM 0
Share

I got in touch with the IronPDF developers, here is the answer:

"Currently Unity 3D isn't supported by IronPDF but it is something we plan on releasing for out next update."

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by rubenmueller · Oct 17, 2019 at 08:26 PM

Edit:
I got in touch with the IronPDF developers, here is the answer:

"Currently Unity 3D isn't supported by IronPDF but it is something we plan on releasing for out next update."

Edit End

I have got the same problem. Editor/Application freezes, in the logfile it says:

Building with mono:

  SecurityException: Couldn't impersonate token.
       at System.Security.Principal.WindowsImpersonationContext..ctor (System.IntPtr token) [0x0001a] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
       at System.Security.Principal.WindowsIdentity.Impersonate (System.IntPtr userToken) [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
       at IronPdf.ThreadSaftyManager.ThreadSafeConverter.Run () [0x00001] in <607c014b8c0046489fc16f0ce66751a3>:0 
       at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
       at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
       at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
     UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
     UnityEngine.DebugLogHandler:LogException(Exception, Object)
     UnityEngine.Logger:LogException(Exception, Object)
     UnityEngine.Debug:LogException(Exception)
     UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)


Building with il2cpp:

 NotSupportedException: C:\Program Files\UnityVersions\2019.1.5f1\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Security.Principal\WindowsImpersonationContext.cpp(27) : Unsupported internal call for IL2CPP:WindowsImpersonationContext::DuplicateToken - "This icall is not supported by il2cpp."
   at System.Security.Principal.WindowsImpersonationContext..ctor (System.IntPtr token) [0x00000] in <00000000000000000000000000000000>:0 
   at System.Security.Principal.WindowsIdentity.Impersonate (System.IntPtr userToken) [0x00000] in <00000000000000000000000000000000>:0 
   at IronPdf.ThreadSaftyManager.ThreadSafeConverter.Run () [0x00000] in <00000000000000000000000000000000>:0 
   at UnityEngine.Events.UnityAction.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
   at System.Runtime.Serialization.DeserializationEventHandler.Invoke (System.Object sender) [0x00000] in <00000000000000000000000000000000>:0 
   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 
   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <00000000000000000000000000000000>:0 
   at UnityEngine.Events.UnityAction.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
 UnityEngine.Logger:LogException(Exception, Object)
 UnityEngine.Debug:LogException(Exception)
 System.Xml.OnDefaultAttributeUseDelegate:Invoke(IDtdDefaultAttributeInfo, XmlTextReaderImpl)

I made a simple testapplication with WPF and there runs IronPDF like a charm.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

110 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Implement M2MQTT for Unity 2 Answers

how can i know about the libraries of c# in unity 1 Answer

Problem iOS compile -library not found? 0 Answers

Can I use any C# libraries in Unity? 2 Answers

do you need xcode libraries of your target ios ? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges