Zitat von John Magolske <[email protected]>:

Hi,
Hi John,


In attempting to get pdfbox running on my Debian Sid system I did:

aptitude install libpdfbox-java
aptitude install libcommons-logging-java
aptitude install libfontbox-java
aptitude install libjempbox-java

Using libraries from the package repository can cause incompatibilities between them. Because you will always get the latest version and not the version the library like pdfbox need to be executed.

Classpath is:

% echo $CLASSPATH
/usr/share/java/pdfbox-1.8.6.jar:/usr/share/java/commons-logging-1.1.3.jar:/usr/share/java/fontbox-1.8.6.jar:/usr/share/java/jempbox-1.8.6.jar

Looks good at the first look. pdfbox expect a commons-logging in the version 1.1.1. but I think this would cause problems.


Java is:

% whence -savc java
/usr/bin/java -> /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java

When summoning pdfbox to convert a PDF to text:

% java -cp /usr/share/java/pdfbox.jar org.apache.pdfbox.ExtractText

With this call you will only add the pdfbox.jar into the classpath not the other jars. Try something like this to test if it maybe work.

% java -cp /usr/share/java/* org.apache.pdfbox.ExtractText


some_file.pdf
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.pdfbox.pdfparser.BaseParser.<clinit>(BaseParser.java:68)
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1234)
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1200)
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1125)
at org.apache.pdfbox.ExtractText.startExtraction(ExtractText.java:212)
        at org.apache.pdfbox.ExtractText.main(ExtractText.java:85)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 6 more

Nothing is converted...not sure where to go from here. Any suggestions?

Thanks,

John
Best regards
Thomas


--
John Magolske
http://B79.net/contact



Reply via email to