Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0 - Beta
    • Fix Version/s: 4.0 - Beta, 4.0
    • Component/s: Viewer RI
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P2

      Description

      Need to show a File Save As dialog to get the path to save the altered PDF to. Then invoke saveAs(File) on the Document object.

      - May have to use SwingUtilities.invokeLater() so that the ui will repaint after the dialog is closed, before doing the save operation.

      - Might want to save on another thread, so that user can continue viewing or PDF. Might not want another thread, so user can't continue altering PDF while it's saving. Specifically thinking about when saving large files, or when saving to network share, how it might take a long time.

      - Might want to show progress while saving.

      - Might want to detect if PDF changed, and if PDF saving supported (might be pro feature), and then un-grey save-as user interface elements.


      Have to decide, if:

      A. Block all access to PDF while save as
      B. Allow read-only viewing, while temporarily disabling further edits, while save as happening

      Have to decide if want to show progress, and means of doing so:

      A. Don't show progress

      B. RI have progress callback, so it calls Document.saveAs(File, ProgressCallback), which it can then use to update some user interface, like the javax.swing.ProgressMonitor mechanism.

      C. Same as B, except instead of ProgressMonitor popup dialog, have something more unobtrusive in the status bar, to facilitate if we use read-only viewing, from the section above.

      D. RI adapt the javax.swing.ProgressMonitorInputStream into an OutputStream, and call Document.saveAs(OutputStream)

        Issue Links

          Activity

          Hide
          Mark Collette added a comment -

          We're going to block all input, and show an hourglass while saving.

          Show
          Mark Collette added a comment - We're going to block all input, and show an hourglass while saving.
          Hide
          Mark Collette added a comment -

          In the RI have it use core Capabilities class, which knows if pro font engine and pro incremental update features are available. Before saving, it will see if incremental updates are available, and if they're not, then show a popup dialog explaining that, and requesting if the user wishes to do a copy of the original pre-existing PDF sans edits, or cancel. This will be shown regardless of whether they've actually edited annotations or not.

          Show
          Mark Collette added a comment - In the RI have it use core Capabilities class, which knows if pro font engine and pro incremental update features are available. Before saving, it will see if incremental updates are available, and if they're not, then show a popup dialog explaining that, and requesting if the user wishes to do a copy of the original pre-existing PDF sans edits, or cancel. This will be shown regardless of whether they've actually edited annotations or not.
          Hide
          Patrick Corless added a comment -

          On other thing to consider is the document permissions if encrypted. The Swing controller has few utility method that can be used to check various security properties; havePermissionToPrint(), havePermissionToExtractContent(), and havePermissionToModifyDocument().

          I suspect the save as menue item should be disabled if havePermissionToModifyDocument() returns false. Alternatively the 'save as' would stay enable but its functionality would switch over to just saving a copy of the document rather then saving an incremental update.

          Show
          Patrick Corless added a comment - On other thing to consider is the document permissions if encrypted. The Swing controller has few utility method that can be used to check various security properties; havePermissionToPrint(), havePermissionToExtractContent(), and havePermissionToModifyDocument(). I suspect the save as menue item should be disabled if havePermissionToModifyDocument() returns false. Alternatively the 'save as' would stay enable but its functionality would switch over to just saving a copy of the document rather then saving an incremental update.
          Hide
          Carlo Guglielmin added a comment -

          Marking as fixed as this code was put in a few days ago to handle the various use cases involving Pro / No Pro, ca save / can't save, etc. Also forced the user to choose a unique filename that is different than the original, and also conveniently providing this for them on the first save (as Filename-new.pdf).

          Show
          Carlo Guglielmin added a comment - Marking as fixed as this code was put in a few days ago to handle the various use cases involving Pro / No Pro, ca save / can't save, etc. Also forced the user to choose a unique filename that is different than the original, and also conveniently providing this for them on the first save (as Filename-new.pdf).

            People

            • Assignee:
              Carlo Guglielmin
              Reporter:
              Mark Collette
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: