Class LinearizedSupport

    • Method Detail

      • invokeOnPageLoadWithDialog

        public void invokeOnPageLoadWithDialog​(int pagenumber,
                                               Runnable r)
        Run an event when the specified page has loaded. A progress dialog will be displayed until it has. This method will also trigger a load of the page if it's not already been done.
        Parameters:
        pagenumber - the page number
        r - the task to run on load, which will be run on the Swing EDT
      • invokeOnPageLoad

        public void invokeOnPageLoad​(int pagenumber,
                                     Runnable r)
        Run an event when the specified page has loaded. No progress updates will be displayed, and the page load will not be triggered.
        Parameters:
        pagenumber - the page number
        r - the task to run on load, which will be run on the Swing EDT
      • invokeOnDocumentLoad

        public void invokeOnDocumentLoad​(Runnable r)
        Run an event when all pages have been loaded. No progress updates will be displayed, and the page load will not be forced.
        Parameters:
        r - the task to run on load, which will be run on the Swing EDT
      • invokeOnCompletion

        public void invokeOnCompletion​(Runnable precondition,
                                       Runnable task)
        Schedule the task to be run on the EDT when the precondition task (run in a background thread) has completed. For example, to run a task on the event queue only when the form is completely loaded:
         invokeOnCompletion(new Runnable() {
             public void run() {
                 pdf.getForm().getElements();
             }
         }, new Runable() {
            public void run() {
                // Do something with form.
            }
         }
         
        Parameters:
        precondition - the Runnable object that must complete first - will be run in a background thread
        task - the optional task to be run when the precondition completes - will be run on the EDT
      • isPageLoaded

        public boolean isPageLoaded​(int pagenumber)
        Return true if the specified page is loaded, false otherwise
        Parameters:
        pagenumber - the pagenumber to query
      • isFullyLoaded

        public boolean isFullyLoaded()
        Return true if the PDF is fully loaded, false otherwise
      • getLoadProgress

        public float getLoadProgress()
        Get the progress of the document load, from 0 to 1 (fully loaded)