Using ApacheFOP v1.0 in .NET application

前端 未结 5 1335
闹比i
闹比i 2020-12-28 10:03

Has anyone successfully complied the Apache FOP v1.0 library to a .NET DLL? I am using the IKVM syntax found at http://onjava.com/pub/a/onjava/2004/08/18/ikvm.html; however

5条回答
  •  一生所求
    2020-12-28 10:46

    I tried the approach suggested by ClayB without any success.

    I used the combinations of IKVM 0.44 and 0.46 with FOP 0.95 and 1.0. But nothing worked! There're some java libs are missing and causing errors. There's also an .net exception occured: could not load type in System.Security namespace. I even tried to compile each .jar file to a dll as suggested by Avik Sengupta at http://onjava.com/pub/a/onjava/2004/08/18/ikvm.html, but got stuck on lib\batik-all-1.7.jar. Unless anyone have got any further workrounds, I'm convinced this approach is no longer working with the latest kits.

    However, I found a different approach which allows one to call FOP from .net. I hope this will help someone:

    try {
        ProcessStartInfo p = new ProcessStartInfo(fopPath + "fop.bat");
        p.Arguments = String.Format("{0} {1}", foFilePath, pdfFilePath);
        p.WindowStyle = ProcessWindowStyle.Hidden;
        p.WorkingDirectory = fopPath;
        Process proc = new System.Diagnostics.Process();
        proc.StartInfo = p;
    
        proc.Start();
        proc.WaitForExit();
        }
    catch() {
    }
    

    Please read the original article at: http://www.ptperalta.net/index.php/technology/using-apache-fop-in-net.html

提交回复
热议问题