Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0.20, 3.0.0 PDFBox
-
None
-
None
Description
open https://www.pdf-online.com/osa/validate.aspx and upload "with_image.pdf" document, validation passed
Execute following code (update absolute paths to files):
byte[] withImage = readFile("C:/r/pdf/with_image.pdf");
try (PDDocument boxDocument = Loader.loadPDF(withImage)) {
boxDocument.removePage(0);
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
boxDocument.save(bos);
byte[] pdfBytes = bos.toByteArray();
Files.write(Path.of("C:/r/pdf/pdf_result.pdf"), pdfBytes);
}
} catch (IOException e) {
e.printStackTrace();
}
upload pdf_result.pdf into https://www.pdf-online.com/osa/validate.aspx , validation is not passed.