Resizing a Canvas App in a Visualforce Page

The following code example shows how to call the resize method to explicitly set the height and width on a specific canvas app within a Visualforce page.

// Set the height and width explicitly and target a canvas app
    // Where 'mycanvas0' is the canvasId on the canvas component 
    // <apex:canvasApp canvasId="mycanvas0"/>
    var target = {canvas : "mycanvas0"};
    Sfdc.canvas.controller.resize( {height : "1000px", width : "900px"}, target);

The following code example shows how to call the resize method to set the height on all canvas apps within a Visualforce page.

//Set only the height on all canvas apps
    Sfdc.canvas.controller.resize( {height : "1000px"});