Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5355

remove page from pdf with image violate conformance level pdf1.7

    XMLWordPrintableJSON

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.

      Attachments

        1. 554dd11e-3c3d-44cd-bc31-d8f960e671e3.pdf
          177 kB
          lappa-lappa
        2. 96977696-26b5-4d53-8fe9-8c8f974de749.pdf
          177 kB
          lappa-lappa
        3. image-2022-01-11-12-57-46-755.png
          125 kB
          lappa-lappa
        4. pdf_result.pdf
          401 kB
          lappa-lappa
        5. with_image.pdf
          408 kB
          lappa-lappa

        Activity

          People

            Unassigned Unassigned
            lappa-lappa lappa-lappa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: