
{% if input.getType() == 'capture' or input.getType() == 'pdf' %}

var rectTop    = {{ input.getRectTop() }},
    rectLeft   = {{ input.getRectLeft() }},
    rectWidth  = {{ input.getRectWidth() }},
    rectHeight = {{ input.getRectHeight() }};

if(rectWidth && rectHeight) {
    
    debug.push(new Date().toISOString().slice(0, -5) + ' [INFO] PhantomJS - Set capture clipping size ~ top: ' + rectTop + ' left: ' + rectLeft + ' ' + rectWidth + 'x' + rectHeight);
    
    page.clipRect = {
        top: rectTop,
        left: rectLeft,
        width: rectWidth,
        height: rectHeight
    };
}

{% endif %}