在.NET应用程序中使用ApacheFOP v1.0 [英] Using ApacheFOP v1.0 in .NET application

查看:143
本文介绍了在.NET应用程序中使用ApacheFOP v1.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人成功将Apache FOP v1.0库编译为.NET DLL吗?我正在使用 http://onjava.com上找到的IKVM语法/pub/a/onjava/2004/08/18/ikvm.html ;但是,已编译的DLL似乎不完整。例如,我不能实例化FopFactory对象:

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, the compiled DLL seems to be incomplete. For example, I cannot instantiate FopFactory object as:

using org.apache.fop.apps;

namespace Utils
{
     public class PdfRender
     {
          public void Render()
          {
            FOUserAgent foUserAgent = fop.getUserAgent();
            FopFactory fopFactory = FopFactory.newInstance();
          }
     }
}


推荐答案

(由FOP用户组的同事提供)

(Courtesy of the folks on the FOP Users Group)

先决条件:已安装IKVM 0.44.0.5。

Prerequisite: IKVM 0.44.0.5 installed.


  1. http://下载FOP 1.0 xmlgraphics.apache.org/fop/1.0/index.html#download

  2. 将所有JAR文件复制到 C:\Fop\Build\ \

  3. 打开命令提示符并运行以下命令: ikvmc -target:library -reference:IKVM.OpenJDK.Core.dll-递归:C:\Fop\Build\\ * .jar -version:1.0 -out:C:\Fop\fop.dll

  4. 在您的Visual Studio项目中,添加对 fop.dll IKVM.OpenJDK。*。dll IKVM.Runtime.dll

  1. Download FOP 1.0 from http://xmlgraphics.apache.org/fop/1.0/index.html#download
  2. Copy all JAR files to C:\Fop\Build\
  3. Open a command prompt and run the following: ikvmc -target:library -reference:IKVM.OpenJDK.Core.dll -recurse:C:\Fop\Build\\*.jar -version:1.0 -out:C:\Fop\fop.dll
  4. In your Visual Studio project, add references to fop.dll, IKVM.OpenJDK.*.dll and IKVM.Runtime.dll

这篇关于在.NET应用程序中使用ApacheFOP v1.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆