previewImage
Collection of functions for creating a preview image for a specific document.
Methods
createPreviewImage
createPreviewImage(
pData):string
Creates a preview image in PNG format for a specific document. For the size, the setting for blobPreviewSize in the Preferences under database is used. If nothing is set or both height and width are set to 0, no image is created.
Parameters
string | number | booleanthe document as an base64 encoded byte[]
Returns
stringThe preview image as an base64 encoded byte[]
Throws
May throw an exception.
getPreviewImage
getPreviewImage(
pData,pFormat,pWidth,pHeight):string
Generates a preview image for a given document.
Parameters
string | number | booleanthe document as an base64 encoded byte[]
string | number | booleanthe format in wich the picture shall be created (eg.: "PNG")
numberthe width of the preview image, if the image width would be smaller than the given width the original width will be used
numberthe heigt of the preview image, if the image height would be smaller than the given height the original heigt will be used
Returns
stringThe preview image as an base64 encoded byte[]
Throws
May throw an exception.
Properties
FORMAT_JPG
stringString constant for the picture format JPG. Application example
Example
var image = previewImage.getPreviewImage(data, previewImage.FORMAT_JPG, 300, 200);
FORMAT_PNG
stringString constant for the picture format PNG. Application example
Example
var image = previewImage.getPreviewImage(data, previewImage.FORMAT_PNG, 300, 200);