PrizmDoc® Viewer v13.28 Release - Updated
PrizmDoc Viewer / API Reference / Viewer Control / Namespace: PCCViewer / Class: SignatureDisplay
In This Topic
    Class: SignatureDisplay
    In This Topic

    PCCViewer. SignatureDisplay

    new SignatureDisplay(domElement, signature) → {Object}

    Builds a DOM preview of the signature, to be used to display the signature outside of the viewer.

    Example

    // create a signature and a div
    var signature = { path: "M0,0L100,0L100,100L0,100L0,0" };
    var div = document.createElement('div');
    
    // generate the signature preview
    PCCViewer.SignatureDisplay(div, signature);
    
    // display the div now
    document.body.appendChild(div);
    
    

    Parameters:

    Name Type Description
    domElement HTMLElement

    The element in which to insert signature preview.

    signature Object | PCCViewer.Signatures~FreehandSignature | PCCViewer.Signatures~TextSignature

    The signature object to render in the preview.

    Throws:

    • If the domElement parameter is undefined or not a valid HTMLElement.

      Type
      Error
    • If the signature parameter is undefined.

      Type
      Error
    • If the signature.path property, in a FreehandSignature object, contains invalid data.

      Type
      Error
    • If the signature.text property, in a TextSignature object, is not a string.

      Type
      Error

    Returns:

    An Object that contains the following properties:

    • width {Number} The calculated width of the signature in pixels.
    • height {Number} The calculated height of the signature in pixels.
    • clear {Function} Remove all inserted content from the original HTMLElement.

    Note: the width and height of a text signature will always be calculated using a 12 point font.

    Type
    Object

    Documentation generated by JSDoc 3.6.10 on Sun Feb 25 2024 19:35:20 GMT+0000 (Coordinated Universal Time)