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
#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.

#refImageRef
Required

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

#typestring
Required

The type of fill.

This must be "image".

#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
#elementsElementAtPoint[]
Optional

Elements to be added to the page

The type has been superseded by ElementAtPoint.

An element that's natively supported by the Canva editor and has positional properties.

The type has been superseded by ImageElementAtPoint.

An element that renders image content and has positional properties.

#altTextAltText
Optional

A description of the image content.

Properties of altText
#decorativeboolean
Optional

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.
#textstring
Required

The text content.

#typestring
Required

The type of element.

This must be "image".

#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.

#leftnumber
Required

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

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

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

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

A rotation, in degrees.

  • Minimum: -180
  • Maximum: 180
#heightnumber
Required

A height, in pixels.

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

A width, in pixels.

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

A page title which must be no longer than 255 characters

Promise<void>