Search Unity

Integrating IronPDF with Unity: Invalid IL code

Discussion in 'Scripting' started by spvn, Mar 11, 2021.

  1. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    80
    Has anybody tried integrating the IronPDF framework with Unity? I have discovered that any version after IronPDF v2020.3 doesn't work with Unity. I've copied the latest version of IronPDF dlls into Unity and simply run a simple line of code:

    IronPdf.HtmlToPdf Renderer = new IronPdf.HtmlToPdf();


    This throws the following error:

    InvalidProgramException: Invalid IL code in IronPdf.HtmlToPdf:.ctor (): IL_0002: pop


    I'm targetting .NET 4.x and using the appropriate DLLs. Any idea if there're any options in Unity that I can change to fix this problem? I'm just trying to use the most basic functions of IronPDF
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    Might want to just grab one off the Unity Asset store then... otherwise I'm not really sure how this would be debugged. It fundamentally sounds incompatible in some code way.
     
  3. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    80
    There's no such alternative off the asset store unfortunately. I need to generate a PDF report from my Unity application...
     
  4. unity_CF8E451222933CCC5720

    unity_CF8E451222933CCC5720

    Joined:
    May 6, 2022
    Posts:
    1
    Sadly got the same problem and no answers :(