Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2928

[PATCH] PDFDocumentGraphics2D does not clear content on nextPage()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2, 2.4
    • 2.7
    • renderer/pdf

    Description

      When switching to a new page using PDFDocumentGraphics2D#nextPage() the current content is added to the PDF document but it is not cleared. Therefore the same content will be repeated on the next page.

      nextPage() calls closePage() which adds this.getString() to the PDFStream.

      this.getString() simply returns the content of currentStream, a StringWriter. The content of currentStream is never cleared and the reference is never set to null. Therefore it will be appended to and it will be added again when the next nextPage() or closePage() or therefore finish() is called.

      A work-arround is to manually set the value of currentStream to null using reflection.

      Attachments

        1. patch-FOP2928-2.diff
          3 kB
          J Frank

        Activity

          People

            jagruti.frank@gmail.com J Frank
            dr0ps123 J├╝rgen Ebert
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: