PDFBox
  1. PDFBox
  2. PDFBOX-632

Invalid page rendering while printing a PDF with an image inside.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.1.0
    • Component/s: None
    • Environment:
      Windows XP SP3 32 bit
      Sun JDK 1.6.0_18

      Description

      As soon as an image is included inside a page, all pages after that page are rendered only within the boundary of this image !?!?!

      Steps to reproduce:

      • create a pdf with 2 pages
      • add an image on the first page (50px,50px) and centered on that page
      • add a text on the second page and centered on that page
      • print the pdf page throught org.apache.pdfbox.PrintPDF

      Attached, you will find a sample pdf to reproduce that bug.

      One more thing... if we use org.apache.pdfbox.PDFToImage instead, all pages are correctly rendered. That's kinda weird !

      1. PDFBOX-632.pdf
        2 kB
        Bertrand Gillis
      2. PDFBOX-632.xps
        28 kB
        Bertrand Gillis
      3. PDFBOX-632.out.pdf
        11 kB
        Maruan Sahyoun
      4. PDFBOX-632.out.win.pdf
        9 kB
        Maruan Sahyoun

        Activity

        Hide
        Bertrand Gillis added a comment -

        A sample pdf file to reproduce the bug.

        Show
        Bertrand Gillis added a comment - A sample pdf file to reproduce the bug.
        Hide
        Bertrand Gillis added a comment -

        The sample pdf file printed to Microsoft XPS Document Writer

        Show
        Bertrand Gillis added a comment - The sample pdf file printed to Microsoft XPS Document Writer
        Hide
        Bertrand Gillis added a comment -

        This issue exists also in pdfbox 0.8.0-incubating.

        Show
        Bertrand Gillis added a comment - This issue exists also in pdfbox 0.8.0-incubating.
        Hide
        Maruan Sahyoun added a comment -

        the issues also occurs using the latest trunk but on Windows only (see PDFBOX-632.out.win.pdf). Mac and Linux work fine (see PDFBOX-632.out.pdf). Printing the pages individually on Windows produces the expected results. What's also visible from the result on Windows is that the box on the first pages seems to be used as a clipping path for the text on the second page.

        Show
        Maruan Sahyoun added a comment - the issues also occurs using the latest trunk but on Windows only (see PDFBOX-632 .out.win.pdf). Mac and Linux work fine (see PDFBOX-632 .out.pdf). Printing the pages individually on Windows produces the expected results. What's also visible from the result on Windows is that the box on the first pages seems to be used as a clipping path for the text on the second page.
        Hide
        Andreas Lehmkühler added a comment - - edited

        I've applied a patch with version 926714.

        The patch ensures that the clipping path is never null. I'd already made a similar patch with PDFBOX-552, but obviously it wasn't good enough.

        Thanks to Maruan for the testing and his conclusion. It was the hint which led me to the solution.

        Show
        Andreas Lehmkühler added a comment - - edited I've applied a patch with version 926714. The patch ensures that the clipping path is never null. I'd already made a similar patch with PDFBOX-552 , but obviously it wasn't good enough. Thanks to Maruan for the testing and his conclusion. It was the hint which led me to the solution.

          People

          • Assignee:
            Unassigned
            Reporter:
            Bertrand Gillis
          • Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development