api/utils/render

Module rendering views as images

Source:

Methods

(static) renderView(options, cb) → {void}

Source:

Function to render views as images

Parameters:
Name Type Description
options object

options required for rendering

Properties
Name Type Description
host string

the hostname

token string

the login token value

view string

the view to open

id string

the id of the block to capture screenshot of

savePath string

path where to save the screenshot

cbFn function

function called after opening the view

beforeScrnCbFn function

function called just before capturing the screenshot

dimensions object

the dimensions of the screenshot

Properties
Name Type Description
width number

the width of the screenshot

height number

the height of the screenshot

padding number

the padding value to subtract from the height of the screenshot

scale number

the scale(ppi) value of the screenshot

cb function

callback function called with the error value or the image data

Returns:

void

Type
void

(inner) fetchChromeExecutablePath() → {Promise}

Source:

Function to fetch Chrome executable

Returns:

Promise

Type
Promise

(inner) saveScreenshot(image, path, source) → {Promise}

Source:

Function to save screenshots

Parameters:
Name Type Description
image Buffer

image data to store

path String

path where image should be stored

source String

who provided image

Returns:

Promise

Type
Promise