addPage

API reference for the addPage method.

Adds a new page immediately after the currently selected page.

#optsobject
Optional

Configuration for the new page to be added.

Properties of opts
#elementsElementAtPoint[]
Optional

Elements to be added to the page

An element that renders image content and has positional properties.

#typestring
Required

The type of element.

This must be "image".

#altTextAltText | undefined
Required

A description of the image content.

Properties of altText
#textstring
Required

The text content.

#decorativeboolean | undefined
Required

Indicates where the alternative text should be displayed.

  • If true, the alternative text will only be displayed in the editor.
  • If false, the alternative text will be displayed in the editor and in view-only mode.
#topnumber
Required

The distance from the top edge of the container, in pixels.

  • The pixels are relative to their container.
  • Minimum: -32768
  • Maximum: 32767
#leftnumber
Required

The distance from the left edge of the container, in pixels.

  • The pixels are relative to their container.
  • Minimum: -32768
  • Maximum: 32767
#widthnumber
Required

A width, in pixels.

  • The pixels are relative to their container.
  • Minimum: 0
  • Maximum: 32767
#heightnumber
Required

A height, in pixels.

  • The pixels are relative to their container.
  • Minimum: 0
  • Maximum: 32767
#rotationnumber
Optional

A rotation, in degrees.

  • Minimum: -180
  • Maximum: 180
#dataUrlstring
Optional

A data URL that contains the image data.

#refImageRef
Optional

A unique identifier that points to an image asset in Canva's backend.

#backgroundPageBackgroundFill
Optional

The page background. This can be a solid color, an image or a video.

Properties of background
#assetobject
Optional

An image or video to use as the fill.

An image asset that fills a path's interior.

#typestring
Required

The type of fill.

This must be "image".

#refImageRef
Required

A unique identifier that points to an image asset in Canva's backend.

#colorstring
Optional

The color of the fill as a hex code.

The hex code must include all six characters and be prefixed with a # symbol.

Example

" #ff0099"
ts
#titlestring
Optional

A page title which must be no longer than 255 characters

Promise<void>