VintaSoft Imaging .NET SDK 14.0: Documentation for Web developer
Vintasoft.Imaging.UI Namespace / WebDocumentViewerBaseJS type / saveChangesAndDownloadFile Methods / saveChangesAndDownloadFile(function,function) Property
Syntax Exceptions Remarks Example BrowserCompatibility SeeAlso
In This Topic
    saveChangesAndDownloadFile(function,function) Method
    In This Topic
    Saves changes in a file, which was previously opened using the WebDocumentViewerBaseJS.openFile or WebDocumentViewerBaseJS.openFileWithAuthentication function, and downloads the file.
    Syntax
    var instance = new Vintasoft.Imaging.UI.WebDocumentViewerBaseJS(settings);
    
    var value; // Type: any
    
    // Parameters
    var successFunc; // Type: function
    var errorFunc; // Type: function
    
    value = instance.saveChangesAndDownloadFile(successFunc, errorFunc);
    
    
    function saveChangesAndDownloadFile(
    successFunc
    Function that will be executed if request is executed successfully.
    Here is function prototype "function __success(data)".
    The data parameter has the following properties:
    • fileId (string): A file identifier.
    : Function,
    errorFunc
    Function that will be executed if request is failed.
    Here is function prototype "function __error(data)".
    The data parameter can be:
    1. An object with following properties:
      • errorMessage (string): Error message.
      • blocked (boolean): Indicates that the requested action is blocked by another request.
      if exception is catched inside web service.
    2. Otherwise, jqXHR object.
    : Function
    ) : any;

    Parameters

    successFunc
    Function that will be executed if request is executed successfully.
    Here is function prototype "function __success(data)".
    The data parameter has the following properties:
    • fileId (string): A file identifier.
    errorFunc
    Function that will be executed if request is failed.
    Here is function prototype "function __error(data)".
    The data parameter can be:
    1. An object with following properties:
      • errorMessage (string): Error message.
      • blocked (boolean): Indicates that the requested action is blocked by another request.
      if exception is catched inside web service.
    2. Otherwise, jqXHR object.
    Exceptions
    ExceptionDescription
    Thrown if argument has wrong type.
    Remarks

    This function saves the following changes: changes (add, remove, swap) in collection of images/pages, changes in annotations, changes in PDF interactive form.

    Example

    ThisJavaScriptcodeshowshowtosavechangesinafile,whichisopenedinwebdocumentviewer:
                      // save changes in a file and download the file
                      docViewer1.saveChangesAndDownloadFile(
                          function(data) {
                              console.log("File changes are saved successfully.");
                          },
                          function(data) {
                              console.log("File changes are not saved.");
                          }
                      );
    

    Browser Compatibility
    56+
    45+
    11
    See Also