EvPageAttributes Interface
The EvPageAttributes TS interface defines a blueprint of a JS object with the attributes of a page in an Envision document.
Properties
An EvPageAttributes object has the following properties:
height: number;A number, the height of a given page in a 2D length unit of measure (UoM) global for the entire evCreate API.
id: string;A string, the unique persistent internal UUID of a given page item. It will not change as long as the page exists.
isMaster: boolean;A Boolean, a flag indicating whether a given page is a master page or a regular document page.
isVisible: boolean;A Boolean, a flag indicating whether a given page is visible or hidden.
margins: EvRect;An
EvRectobject, a rectangular area that defines the margins of a given page in the length UoM global for the evCreate API.optional masterPage: EvItem;A Page item object, the master page of a given page item.
name: string;A string, the name of a given page. If it is not given, the system generates the name.
unit: EvDocUnit;A member of the
EvDocUnitenumeration, a UoM displayed for 2D length measurements on a given page in the GUI.width: number;A number, the width of a given page in the length UoM global for the evCreate API.
Examples
TS
JS
- { height: 1080, id: "abcdefg", isMaster: false, isVisible: true, margins: { bottom: 1070, left: 10, right: 1430, top: 10, }, masterPage: { item: "page", data: { id: "zxcvbnas" } }, name: "Title", unit: EvDocUnit.mm, width: 1440 }
- { height: 1080, id: "abcdefg", isMaster: false, isVisible: true, margins: { bottom: 1070, left: 10, right: 1430, top: 10, }, masterPage: { item: "page", data: { id: "zxcvbnas" } }, name: "Title", unit: "mm", width: 1440 }
Discussion
For 2D length measurements and calculations, the evCreate API uses the length UoM set globally for the entire API with the ConfigureOptions(opt: EvCreateApiOptions): Promise<EvCreateApiOptions> function. Thus, the global length UoM is always used for the following data:
The numbers in the
heightandwidthproperties.The
EvRectobject in themarginsproperty.
However, the unit property can be set to a length UoM different from the global one with the SetUnit(page: EvItem, unit: EvDocUnit): Promise<void> function. In such a case:
The evCreate API will still use the global UoM for measurements and calculations on the given page, including the
height,width, andmarginsproperties.The given page will show the UoM set with the
unitproperty to the user in the GUI.
To learn the global UoM, use the GetCurrentOptions(): Promise<EvCreateApiOptions> function.