# Getting the Size of a Canvas App

The following code example shows how to call the `size` method to get the size of the canvas app. The `console.log` function outputs the frame sizes so you can see the sizes change as you resize the canvas app.

```java
// Get the canvas app sizes in the sizes object.
var sizes = Sfdc.canvas.client.size();

console.log("contentHeight; " + sizes.heights.contentHeight);
console.log("pageHeight; " + sizes.heights.pageHeight);
console.log("scrollTop; " + sizes.heights.scrollTop);
console.log("contentWidth; " + sizes.widths.contentWidth);
console.log("pageWidth; " + sizes.widths.pageWidth);
console.log("scrollLeft; " + sizes.widths.scrollLeft);

// Resize the canvas app.
Sfdc.canvas(function() {
    sr = JSON.parse('<%=signedRequestJson%>');
    Sfdc.canvas.client.autogrow(sr.client);
});
```

**See Also**

- [Resizing a Canvas App](/docs/platform/canvas-framework/guide/canvas-app-resizing.md)
- [Subscribing to Parent Events](/docs/platform/canvas-framework/guide/canvas-app-subscribe-code-example.md)
