pdfbox3 upgrade and fix

This commit is contained in:
Anthony Stirling
2024-01-12 23:15:27 +00:00
parent 77dcf04cfe
commit 5281d7a49a
33 changed files with 131 additions and 91 deletions

View File

@@ -3,6 +3,7 @@ package stirling.software.SPDF.model.api;
import java.io.IOException;
import java.util.List;
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.pdmodel.PDDocument;
import io.swagger.v3.oas.annotations.Hidden;
@@ -27,7 +28,7 @@ public class PDFWithPageNums extends PDFFile {
public List<Integer> getPageNumbersList() {
int pageCount = 0;
try {
pageCount = PDDocument.load(getFileInput().getInputStream()).getNumberOfPages();
pageCount = Loader.loadPDF(getFileInput().getBytes()).getNumberOfPages();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();