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

Interrupt does not interrupt loading of a PDF

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0.8
    • Fix Version/s: None
    • Component/s: Parsing
    • Labels:
      None

      Description

      PDDocument.load can take quite some time. It would be nice to be able to interrupt the thread if desired.

      It is also natural to expect that the method PDDocument.load will cease treatment if the thread gets interrupted, similar to e.g. reading a file using a method from the JDK.

      This test class illustrates the problem (the test is green, the problem is only exhibited in the log): running the test on some big file in.pdf shows that the thread goes to the end, even if it takes several seconds more than the time it gets interrupted.

      The companion class InterruptReadTest.java shows the expected interruption behavior, by contrast, using a normal file read from the JDK: the read stops (almost) as soon as the thread gets interrupted.

      I suppose the same can be said about save, although I have not tested it in detail.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              oliviercailloux Olivier Cailloux
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: