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

Printing a PDF with transparent images causes nothing to print for that page

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.0.5
    • None
    • Rendering

    Description

      I have a PDF with 2 images in it on 2 separate pages. Each page also has some text. When I try to print the PDF, the first page renders fine, but nothing renders for the second page and I get a blank page printed.

          String sourcePDF = "C:\\temp\\CPTest\\MyTest.pdf";
          PrinterJob job = PrinterJob.getPrinterJob();
          try (PDDocument document = PDDocument.load(new File(sourcePDF))) {
            job.setPageable(new PDFPageable(document);
            PrintService service = getPrintService("Adobe PDF");
            job.setPrintService(service);
            job.print();
          } catch (IOException | PrinterException e) {
            throw new RuntimeException("Unable to print file " + sourcePDF + ".", e);
          }
      

      I have also tried printing to a physical printer with the same results. Saves me paper by just using the Adobe PDF printer.

      Attachments

        1. Java Printing Test.pdf
          378 kB
          Jon Ominsky
        2. Mytest.pdf
          1.92 MB
          Jon Ominsky
        3. PDFBOX-3776-reduced.pdf
          153 kB
          Tilman Hausherr

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jominsky Jon Ominsky
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: