Using IKVM to convert JAR (Flying Saucer - xhtmlrenderer)

I wanted to use the Flying Saucer Java API in .NET, so I tried using IKVM to convert the Flying Saucer library :

ikvmc core-renderer.jar

For some reason, IKVMC gave me an exe core-renderer.exe, so I renamed it to core-renderer.dll, added it to my builds and hacked

using java.io;
using java.lang;
using com.lowagie.text;
using org.xhtmlrenderer.pdf;

namespace flying_saucer
{
    class FlyingSaucerApp
    {
        static void Main(string[] args)
        {
            // This works
            DocumentException dummy = new DocumentException();

            ITextRenderer renderer = new ITextRenderer();


            // For some reason, this raises NoClassDefFoundError                
            renderer.setDocument(File("hello.xhtml").toURI().toURL().toString());
        }
    }
}

For some reason he gives java.lang.NoClassDefFoundError: com.lowagie.text.DocumentException. I realized that there DocumentExceptionmight be something ITextRender(), but have I already included com.lowagie.textany ideas?

+3
source share
2 answers

, Flying Saucer, iText ( Flying Saucer) Flying Saucer :

ikvmc -target:library itext.jar
ikvmc -target:library -reference:itext.dll core-renderer.jar

( : , , DLL, IKVMC, - - IKVMC JAR iText)

+5

, IKVM.AWT.WinForms.dll, IKVM.OpenJDK.ClassLibrary.dll, IKVM.Runtime.dll IKVM.Runtime.JNI.dll. , , , -target:library .

+2

Source: https://habr.com/ru/post/1747943/


All Articles