#792676 libpdfbox-java: pdfannotextractor.pl fails to find org.pdfbox.cos.ICOSVisitor class

#792676#5
Date:
2015-07-17 12:18:44 UTC
From:
To:
Dear Maintainer,

I am trying to apply the solution proposed in this answer
http://tex.stackexchange.com/a/48118/82119 but on following the first
step, the pdfannotextractor.pl dies with:

$ /usr/share/texlive/texmf-dist/scripts/pax/pdfannotextractor.pl capturing-ddl.pdf
PDFAnnotExtractor 0.1l, 2012/04/18 - Copyright (c) 2008, 2011, 2012 by Heiko Oberdiek.
Exception in thread "main" java.lang.NoClassDefFoundError: org/pdfbox/cos/ICOSVisitor
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
        at java.lang.Class.getMethod0(Class.java:2856)
        at java.lang.Class.getMethod(Class.java:1668)
        at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.pdfbox.cos.ICOSVisitor
        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

I have no idea how to fix this problem.  Maybe I need to specify a
classpath or something?  I looked at the .pl file itself and there's a
--install option, but on running it, it says the PDFBox "is already
found":

$ /usr/share/texlive/texmf-dist/scripts/pax/pdfannotextractor.pl
--install
PDFAnnotExtractor 0.1l, 2012/04/18 - Copyright (c) 2008, 2011, 2012 by Heiko Oberdiek.
* Nothing to do, because PDFBox is already found:
  /usr/share/java/pdfbox.jar

Not quite sure what to do next.  Maybe it's just missing a dependency?

#792676#10
Date:
2015-07-17 12:59:17 UTC
From:
To:
Control: reassign -1 texlive-latex-extra

Some observations:

* /usr/share/texlive/texmf-dist/scripts/pax/pdfannotextractor.pl would
  download PDFBox-0.7.3.zip from Sourceforge. That's a quite old
  version (in Debian in oldoldstable).
* Looking at
  pdfbox/src/main/java/org/apache/pdfbox/cos/ICOSVisitor.java (in the
  PDFBox source), I guess that this class is called
  org.apache.pdfbox.cos (and not org.pdfbox.cos) by now.
  A diff in the git repo (upstream tags) shows the same. Pseudo-diff:

diff --git a/current/src/org/pdfbox/cos/ICOSVisitor.java b/current/src/org/pdfbox/cos/ICOSVisitor.java
deleted file mode 100644
index 04b7542..0000000
--- a/current/src/org/pdfbox/cos/ICOSVisitor.java
+++ /dev/null

#792676#19
Date:
2015-07-17 13:12:07 UTC
From:
To:
Hi all,

Can this please reported to upupstream Heiko Oberdiek - otherwise
there will be no fix.

Thanks

Norbert

#792676#24
Date:
2015-07-23 21:12:20 UTC
From:
To:
severity 670040 important
merge 670040 792676
stop
Known issue. Merging.

H.

#792676#31
Date:
2022-07-23 22:10:16 UTC
From:
To:
Am 22.04.2012 um 15:27 teilte Juhapekka Tolvanen mit:

Hi,
hille@sid-amd64:~$ java -jar
/usr/share/texlive/texmf-dist/scripts/pax/pax.jar tps62120.pdf
* Processing file `tps62120.pdf' ...
hille@sid-amd64:~$ ls -ltr

This should have been solved years ago, we just forgot to close it sorry!

Hilmar