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.out.pdf
        11 kB
        Maruan Sahyoun
      2. PDFBOX-632.out.win.pdf
        9 kB
        Maruan Sahyoun
      3. PDFBOX-632.pdf
        2 kB
        Bertrand Gillis
      4. PDFBOX-632.xps
        28 kB
        Bertrand Gillis

        Activity

        Bertrand Gillis created issue -
        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.
        Bertrand Gillis made changes -
        Field Original Value New Value
        Attachment PDFBOX-632.pdf [ 12436697 ]
        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
        Bertrand Gillis made changes -
        Attachment PDFBOX-632.xps [ 12436698 ]
        Bertrand Gillis made changes -
        Labels image print printing render rendering image pdfbox print printing render rendering
        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.
        Maruan Sahyoun made changes -
        Attachment PDFBOX-632.out.pdf [ 12439577 ]
        Attachment PDFBOX-632.out.win.pdf [ 12439578 ]
        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.
        Andreas Lehmkühler made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.1.0 [ 12314761 ]
        Resolution Fixed [ 1 ]
        Jukka Zitting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        28d 8h 39m 1 Andreas Lehmkühler 23/Mar/10 18:44
        Resolved Resolved Closed Closed
        6d 13h 38m 1 Jukka Zitting 30/Mar/10 09:23

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development