PrizmDoc® v14.3 Preview Release - Updated
PrizmDoc / API Reference / Viewer Control / Namespace: PCCViewer / Class: DocumentTagRequest
In This Topic
    Class: DocumentTagRequest
    In This Topic

    PCCViewer. DocumentTagRequest

    (protected) new DocumentTagRequest()

    The DocumentTagRequest object is created when tagging a document. It triggers events to indicate document tagging progress and it has properties to get the document tags and status.

    This constructor should not be used directly. Instead, a document tag request is created by PCCViewer.ViewerControl#tagDocument.

    Example

    // A DocumentTagRequest object is created by and returned from the call to the tagDocument method
    var documentTagRequest = viewerControl.tagDocument();
    
    

    Members

    (readonly) documentTags :string

    Returns a string of the document tags produced by this DocumentTagRequest.

    An ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.

    Type:

    • string
    See:

    (readonly) errorCode :number

    Gets the error code if there was an error. If there was no error, null will be returned.

    An ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.

    Type:

    • number
    See:

    (readonly) errorMessage :string

    Returns a plain text, human-readable, fixed-local message that explains the error condition. If there was no error, null will be returned.

    An ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.

    Type:

    • string
    See:

    Methods

    getDocumentTags() → {Array.<string>}

    Returns a string of the document tags produced by this DocumentTagRequest.

    Example

    var documentTags = documentTagRequest.getDocumentTags();
    
    

    Returns:

    An array of tags for the document.

    Type
    Array.<string>

    getErrorCode() → {number}

    Returns the error code if there was an error. If there was no error, null will be returned.

    Example

    var errorCode = documentTagRequest.getErrorCode();
    
    

    Returns:

    An error code indicating the type of error, or null.

    The possible error codes are:

    • 1010 - An unexpected exception occurred.
    • 1011 - There was a failure retrieving data from the server.
    • ServerSearchUnavailable - Server-side search is not available.
    Type
    number

    getErrorMessage() → {string}

    Returns a plain text, human-readable, fixed-local message that explains the error condition. If there was no error, null will be returned.

    Example

    var errorMessage = documentTagRequest.getErrorMessage();
    
    

    Returns:

    A plain text error message that explains the error condition, or null.

    Type
    string

    off(eventType, handler) → {PCCViewer.DocumentTagRequest}

    Unsubscribe a handler from an event of the DocumentTagRequest.

    Typically, event is unsubscribed when you no longer want further notification of the event.

    Example

    // subscribe
    documentTagRequest.on(PCCViewer.EventType.DocumentTagCompleted, onDocumentTagCompleted);
    
    // unsubscribe
    documentTagRequest.off(PCCViewer.EventType.DocumentTagCompleted, onDocumentTagCompleted);
    
    // handler declaration
    function onDocumentTagCompleted(ev) {
        alert("Document tag completed!");
    }
    
    

    Parameters:

    Name Type Description
    eventType string

    A string specifying the event type. See PCCViewer.DocumentTagRequest#on for possible values.

    handler function

    The function that was previously subscribed to the event type.

    Returns:

    The DocumentTagRequest object on which this method was called.

    Type
    PCCViewer.DocumentTagRequest

    on(eventType, handler) → {PCCViewer.DocumentTagRequest}

    Subscribe a handler to an event of the DocumentTagRequest.

    Example

    // subscribe
    documentTagRequest.on(PCCViewer.EventType.DocumentTagCompleted, onDocumentTagCompleted);
    
    // handler declaration
    function onDocumentTagCompleted(ev) {
        alert("Document tag complete!");
    }
    
    

    Parameters:

    Name Type Description
    eventType string

    A string that specifies the event type.

    handler function

    The function that will be called whenever the event is triggered.

    Returns:

    The DocumentTagRequest object on which this method was called.

    Type
    PCCViewer.DocumentTagRequest

    Documentation generated by JSDoc 3.6.10 on Thu Oct 31 2024 15:02:24 GMT+0000 (Coordinated Universal Time)