I'm using either pdfbox-app-2.0.18.jar or pdfbox-app-2.0.17.jar.
From the example here, I have this code below :
try (FileOutputStream fos = new FileOutputStream(signedFile);
PDDocument doc = Loader.loadPDF(inputFile)) {
// code
}
After executing this code, I'm getting this error given below :
org.apache.pdfbox.Loader is not found
How to resolve this issue ?
Loader class is never introduced in version 2.x or lower. So, you can't use it.
Alternatively, you can use load() method from PDDocument class to load PDF files.
Modify to this :
try (FileOutputStream fos = new FileOutputStream(signedFile);
PDDocument document = PDDocument.load(inputFile)) {
// code
}
Read this :- https://pdfbox.apache.org/2.0/migration.html
The Loader class has been added January 25, 2020. SVN log
It's not part of version 2.0.18, as it is not in this file: pdfbox-2.0.18-src.zip
So this class is simply too new and that's why you cannot use it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With