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

查看:27
本文介绍了在 .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://xmlgraphics.apache.org/fop 下载 FOP 1.0/1.0/index.html#download
  2. 将所有 JAR 文件复制到 C:\Fop\Build\
  3. 打开命令提示符并运行以下命令:ikvmc -target:library -reference:IKVM.OpenJDK.Core.dll -recurse:C:\Fop\Build\\*.jar -version:1.0 -out:C:\Fop\fop.dll
  4. 在您的 Visual Studio 项目中,添加对 fop.dllIKVM.OpenJDK.*.dllIKVM.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天全站免登陆