VintaSoft Imaging .NET SDK 14.1: Документация для Веб разработчика
Vintasoft.Imaging.UI Namespace / WebDocumentViewerBaseJS type / openFileWithAuthentication Methods / openFileWithAuthentication(Vintasoft.Shared.WebFileInfoJS,function) Property
Syntax Remarks Example BrowserCompatibility SeeAlso
openFileWithAuthentication(Vintasoft.Shared.WebFileInfoJS,function) Метод
Sends an asynchronous request to a server, gets information (with file authentication) about images, which are stored in file on server, clears the web document viewer and adds images to the web document viewer.
Синтаксис
var instance = new Vintasoft.Imaging.UI.WebDocumentViewerBaseJS(settings);

var value; // Type: any

// Parameters
var fileId; // Type: WebFileInfoJS
var successFunc; // Type: function

value = instance.openFileWithAuthentication(fileId, successFunc);

Parameters

fileId
Экземпляр класса WebFileInfoJS.
successFunc
Функция, которая будет выполнена, если запрос выполнен успешно.
Вот прототип функции "function __success(data)".
Параметр 'data' имеет следующие свойства:
  • imageInfos (object): Информация об изображениях в файле изображения.
  • isAuthenticationRequired (boolean): Значение, указывающее, требует ли текущий файл изображения аутентификации.
  • images (object): Массив объектов WebImageJS, созданный с использованием свойства imageInfos.
Ремарки

Метод вызывает событие fileOpened, если файл открыт успешно.

Пример

ThisJavaScriptcodeshowshowtoopenfile,whichisstoredonserverandhavepassword,inwebdocumentviewer:
                  // open file with authentication - the web document viewer will show the password dialog only if specified password is not correct
                  docViewer1.openFileWithAuthentication(
                      new Vintasoft.Shared.WebFileInfoJS("pdfDocumentWithPassword.pdf", 'password'),
                      function(data) {
                          console.log("File is opened successfully.");
                      }
                  );

Совместимость с веб браузерами
9
5
11
5
Смотрите также