getCurrentPageContext
API reference for the getCurrentPageContext method.
Gets information about the current page in the user's design.
To see how this method is used, see Positioning elements.
Usage
import { getCurrentPageContext } from "@canva/design";
(async () => {
const context = await getCurrentPageContext();
console.log(context);
})();
Returns
A Promise
that resolves with the following object:
The successful result of getting the current page context.
The dimensions of the page, in pixels.
The width of the page, in pixels.
The height of the page, in pixels.