Calling evCreate API in Browser Console
You can explore the evCreate API by calling its functions in the console of the browser tab that hosts the Canvas Envision Editor.
Calling functions in the browser console
To call evCreate API functions in the browser console:
Create or open an Envision document in the Canvas Envision Creator.
Open the browser console.
In the browser console, enter the evCreate API function you want to call and press Enter.
Explore and process the return value of the called function.
Explore the result of calling the function in the document and compare it against the return value.
Opening the browser console
You can open the browser console for a given web page in multiple ways. The general procedure is the same across the supported browsers:
Open the Developer tools browser pane, either:
Press F12.
Press Ctrl+Shift+I.
On the browser toolbar, click the ellipsis button and then More tools > Developer tools.
In the Developer tools browser pane, click the Console tab on a toolbar of the upper or lower pane section.
If the Console tab is not visible on the pane section toolbar, click the More tools button on this toolbar and then click Console from the menu.
Function call expression statement
When calling an evCreate API function in the browser console, you should enter it as follows:
Where:
await
A global JS operator that pauses the function execution until the returned
Promise
is fulfilled or rejected. If thePromise
is fulfilled, the console outputs a value (data object) unwrapped from thePromise
. If thePromise
is rejected, the console throws an error. You can omitawait
for functions that return a standard JS datatype value, custom data object, or nothing. Calling a function that returns aPromise
withoutawait
will output the unwrappedPromise
to the console if thisPromise
is fulfilled.window
A global variable representing the browser window that runs the Canvas Envision Editor and exposes the evCreate API to external systems. For quick input, you can omit
window
globally in the browser console. In such a case, the console implicitly assumes thewindow
namespace. However, you should explicitly specify it in the namespaces nested in compound calls, JS scripts, and files.evCreate
The namespace of the evCreate API that provides access to the API sections represented as nested namespaces.
namespace
The namespace of an evCreate API section that represents items, objects, or functionality and provides access to functions for working with them, such as
document
,page
,object
,object.text
,object.text.edit
, and so on.Function()
A function in a given API namespace to be executed with the provided arguments. Depending on the function declaration, you can or must provide no, one, or more than one argument.
For example:
Closing the browser console
You can close the opened browser console for a given web page in multiple ways. The general procedure is the same across the supported browsers, either:
Press F12.
Press Ctrl+Shift+I.
On the right side of the Developer tools browser pane toolbar, click X.