PDFBox - Building the latest version for .NET using IKVM

99封情书 提交于 2019-12-21 21:31:29

问题


I would like to build the latest version of PDFBox (http://pdfbox.apache.org/userguide/dot_net.html) for use within my .NET project.

I have no experience with Java whatsoever but I am using the steps defined here: http://www.ikvm.net/userguide/tutorial.html

I am using the following versions:
- IKVM (0.42.0.6)
- PDFBox (1.2.1) JAR file

The problem is that when I try to create the DLL a series of error messages are displayed - i.e. "java.lang.NoClassDefFoundError". I am facing the same problem as the author here (How to use PDFBox 1.0 in .net / C# environment using IKVM) and tried the fix suggested - "lkvmc.exe -target:library -out:"[Output Path]\netpdfbox.dll" "[PDFBox Path]*.jar" but the result is the same - the error messages are still displayed.

Thanks in advance,

Jose


回答1:


You have to include all needed *.jar files in classpath. I translated latest version with same setup and main problem was that there were no default log class, so I included jar's for log4j and it seems that now is working OK, but I was only doing text extraction. And version 0.7.3 was throwing exceptions on some PDF files and this new build works OK on same PDF files. You can download dll's from :

http://www.antoniob.com/pdfbox-121-for-net-binaries.aspx




回答2:


There is also a new site that will be releasing .NET DLLs for every PDFBox release until the actual project begins doing an official .NET release. So far they only have 1.6.0 (the latest version at the time of this writing), but hopefully they keep it up. See http://pdfbox.lehmi.de



来源:https://stackoverflow.com/questions/3460987/pdfbox-building-the-latest-version-for-net-using-ikvm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!