ICEpdf
  1. ICEpdf
  2. PDF-848

Add a Timeout value for Document getPageImage call

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.1
    • Fix Version/s: 5.1.2
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      All

      Description

      A customer has requested we add a Timeout value for Document getPageImage call. Their use case is as follows:

      "We would like to be able to specify a timeout value for calls to getPageImage.
      Some of our high volume customers simultaneously upload multiple complex/time consuming pdfs to render .
      We would like to time out these requests as system responsiveness is more important than actually rendering the image for some of our workflows.
      In our current implementation, our calling thread will time out and return the page to the user, but IcePDF continues to consume resources processing the request to getPageImage."

        Activity

        Hide
        Patrick Corless added a comment -

        I've taken some time to look into this enhancement request in more detail. To simply have our getPageImage() method return after x number of seconds would require quite a few changes to our core and ultimately slow down the rendering of PDF's. Another option is to support interruption with in the rendering core which would offer support of task cancellation via a variety of ICEpdf method calls. A few changes to the core are needed to support task cancellation. With this work complete it would be relatively simple to build out an reference implementation that could take advantage of time limited activities. It should be noted that getpageImage() method wouldn't result in an interrupt exception being through but rather task cancellation that returns a page image that may not be fully rendered.

        Attached is code that would setup a guarded thread that will terminate the task thread in 3600 ms. I would request that the customer reviews this potential solution to their enhancement request.
        .

        Show
        Patrick Corless added a comment - I've taken some time to look into this enhancement request in more detail. To simply have our getPageImage() method return after x number of seconds would require quite a few changes to our core and ultimately slow down the rendering of PDF's. Another option is to support interruption with in the rendering core which would offer support of task cancellation via a variety of ICEpdf method calls. A few changes to the core are needed to support task cancellation. With this work complete it would be relatively simple to build out an reference implementation that could take advantage of time limited activities. It should be noted that getpageImage() method wouldn't result in an interrupt exception being through but rather task cancellation that returns a page image that may not be fully rendered. Attached is code that would setup a guarded thread that will terminate the task thread in 3600 ms. I would request that the customer reviews this potential solution to their enhancement request. .
        Hide
        Patrick Corless added a comment -

        Checked in code changes, we'll schedule a drop for the customer to evaluate.

        Show
        Patrick Corless added a comment - Checked in code changes, we'll schedule a drop for the customer to evaluate.
        Hide
        Patrick Corless added a comment -

        The addition of a interuptable Page initialization and paint has been added.

        Show
        Patrick Corless added a comment - The addition of a interuptable Page initialization and paint has been added.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: