Bug#1129390: allow the command-line tools to be invoked as executables
John Scott
jscott at posteo.net
Sun Mar 1 17:37:30 GMT 2026
Source: libpdfbox2-java
Version: 2.0.29-1
Severity: normal
Hello,
It appears that libpdfbox2 has command-line utilities for end users: https://pdfbox.apache.org/2.0/commandline.html
However this package doesn't install anything in /usr/bin/ where users will like to find them. I don't know anything about Java, so getting this to work has been challenging. Invoking the .jar manually one finds
$ java -jar /usr/share/java/pdfbox2-tools.jar
no main manifest attribute, in /usr/share/java/pdfbox2-tools.jar
(Note that the upstream documentation I linked to refers to a "pdfbox*-app.jar" which isn't installed anywhere; maybe we just need to build it?
After some guessing I found a command-line that works:
$ java -cp '/usr/share/java/pdfbox2-tools.jar:/usr/share/java/pdfbox2.jar' org.apache.pdfbox.tools.PDFBox
PDFBox version: "2.0.29"
Usage: java -jar pdfbox-app-x.y.z.jar <command> <args..>
Possible commands are:
Decrypt
Encrypt
ExtractText
ExtractXMP
ExtractImages
OverlayPDF
PrintPDF
PDFMerger
PDFReader
PDFSplit
PDFToImage
TextToPDF
WriteDecodedDoc
(Note that this command-line help also refers to my invocation as "pdfbox-app"; maybe that's supposed to be a wrapper that sets stuff up correctly?)
I think some wizardry in the javahelper package exists to set up the right bits. However you should probably see if the upstream build system has a way to set things up. For example, the ImportXFDF command https://sources.debian.org/src/libpdfbox2-java/2.0.29-1/tools/src/main/java/org/apache/pdfbox/tools/ImportXFDF.java isn't recognized, but it can still be used with a tweak:
CLASSPATH="/usr/share/java/pdfbox2-tools.jar:/usr/share/java/pdfbox2.jar" java org.apache.pdfbox.tools.ImportXFDF
-- System Information:
Debian Release: 13.3
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.12.69+deb13-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 411 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-maintainers/attachments/20260301/5dc62131/attachment.sig>
More information about the pkg-java-maintainers
mailing list