evCreate API 5.7 Help

CreateAt Function

Creates a new text item prepopulated with given content and formatting within a dynamic bounding box at a given position in an Envision document currently opened in the Canvas Envision Creator app.

CreateAt( text: string, at: [[[EvCoord2D|evcoord2d-type-alias.html]]], width?: number, zOrder?: [[[EvObjectZOrder|evobjectzorder-interface.html]]], font?: [[[EvFontStyle|evfontstyle-interface.html]]], withMarkdown?: boolean ): Promise<[[[EvItem|canvas-envision-document-items.html#object-items]]]>

Parameters

text: string

A string, the text that should be contained in the new text item.

at: EvCoord2D

An EvCoord2D type alias, the 2D coordinates where the top left corner of the dynamic bounding box of the new text item should be located on the page.

width?: number

A number, the width of the bounding box of the new text item in the length UoM global for the evCreate API.

If this parameter is not given, the text is placed on a single line. If it is given, the width of the bounding box is fixed, and the height depends on the size of the given text—the number of lines that fit the given width.

zOrder?: EvObjectZOrder

An EvObjectZOrder object that includes:

  • The layer item object of a layer in the current document where the new text item should be added. The default value is the current layer on the current page.

  • The position of the new text item in the stack of object items on the given layer. It is a zero-based index that is 0 for the topmost object item on the layer and increases by 1 for each following object item going down the stack. The default value is 0.

font?: EvFontStyle

An EvFontStyle object, a custom text formatting that should be applied to the text contained in the new text item.

If Markdown formatting is included in the given text, it is applied to this text after the custom text formatting has been applied.

withMarkdown?: boolean

A Boolean, a flag to indicate whether the given text includes (true) or does not include (false) Markdown formatting.

The default value is false.

Return value

Promise<EvItem>

A Promise that, if fulfilled, resolves to an Object item object of the new text item successfully created within the dynamic bounding box at the given position in the current document.

18 April 2025