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

PDFDebugger does not remove listeners for PagePane when opening new File

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.26
    • 2.0.27
    • Utilities
    • None

    Description

      A PagePane reacts to changes made to the "Repair AcroForm" setting.

      However this only works without errors for the first document opened in an instance of the PDFDebugger.
      For any further document opened, an error is produced when changing the setting while the second document is opened. The listeners probably need to be removed when loading a new document (or when closing switching/away from the PagePane).

      java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.io.IOException: COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed?
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:485)
          java.desktop/sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
          java.base/java.security.AccessController.doPrivileged(Native Method)
          java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
      Caused by: java.util.concurrent.ExecutionException: java.io.IOException: COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed?
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:465)
          java.desktop/sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
          java.base/java.security.AccessController.doPrivileged(Native Method)
          java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
      Caused by: java.io.IOException: COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed?
          org.apache.pdfbox.cos.COSStream.checkClosed(COSStream.java:83)
          org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:168)
          org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:163)
          org.apache.pdfbox.pdmodel.PDPage.getContents(PDPage.java:157)
          org.apache.pdfbox.pdfparser.PDFStreamParser.<init>(PDFStreamParser.java:91)
          org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:535)
          org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:516)
          org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
          org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:279)
          org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:355)
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:453)
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:435)
          java.base/java.lang.Thread.run(Thread.java:829) 

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            moritzf Moritz Flöter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: