Preprocess

Description Returns essential information about the document, that needed to proceed with opening. This API is designed to optimize opening documents, and to get all the required information of the document with a single call.
Method Type POST
URL api/document/preprocess
Parameters
Name Type Description
DocumentID Object

The specified document’s DocumentID.

The DocumentID can be any object, for example an absolute path of a file, or a database row ID. The specified Content-Engine will interpret the DocumentID and serve the document.

CE (Optional) String

The Specified Content-Engine.

Possible values:

0: Default Content-Engine (default)

1: FileEngine

2: DatabaseEngine

Response Type JSON (JsonResult)
Return values

{

exists (Bool )

type ( FileType )

pages ( Int ) [Number of pages]

}

Programming notes

None

Example

JavaScript Example

function PreProcess(documentID) {

return new Promise((resolve, reject) => {

$.ajax({

type: "POST",

url: API_Preprocess,

cache: false,

data: { DocumentID: documentID, CE: _getContentEngine() },

success: function (result) {

resolve(result);

},

error: function (xhr, textStatus, message) {

resolve(false);

}

});

});

}

PreProcess(documentID).then(result => {

if (!result.exists) {

// document does not exist, optionally display an error

resolve(false);

return;

}

let type = result.type;

let numOfPages = result.pages;

})

Requirements