Visio.PageView class

Represents the PageView class.

[ API set: 1.1 ]

Extends
OfficeExtension.ClientObject

Properties

zoom

Get and set Page's Zoom level. The value can be between 10 and 400 and denotes the percentage of zoom.

[ API set: 1.1 ]

Methods

centerViewportOnShape(ShapeId)

Pans the Visio drawing to place the specified shape in the center of the view.

[ API set: 1.1 ]

fitToWindow()

Fit Page to current window.

[ API set: 1.1 ]

getPosition()

Returns the position object that specifies the position of the page in the view.

[ API set: 1.1 ]

getSelection()

Represents the Selection in the page.

[ API set: 1.1 ]

isShapeInViewport(Shape)

To check if the shape is in view of the page or not.

[ API set: 1.1 ]

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

setPosition(Position)

Sets the position of the page in the view.

[ API set: 1.1 ]

toJSON()

Property Details

zoom

Get and set Page's Zoom level. The value can be between 10 and 400 and denotes the percentage of zoom.

[ API set: 1.1 ]

zoom: number;
Property Value
number

Method Details

centerViewportOnShape(ShapeId)

Pans the Visio drawing to place the specified shape in the center of the view.

[ API set: 1.1 ]

centerViewportOnShape(ShapeId: number): void;
Parameters
ShapeId
number

ShapeId to be seen in the center.

Returns
void

Examples

Visio.run(session, function (ctx) {
    var activePage = ctx.document.getActivePage();
    var shape = activePage.shapes.getItem(0);
    activePage.view.centerViewportOnShape(shape.Id);
    return ctx.sync();
}).catch(function(error) {
    console.log("Error: " + error);
    if (error instanceof OfficeExtension.Error) {
        console.log("Debug info: " + JSON.stringify(error.debugInfo));
    }
});

fitToWindow()

Fit Page to current window.

[ API set: 1.1 ]

fitToWindow(): void;
Returns
void

getPosition()

Returns the position object that specifies the position of the page in the view.

[ API set: 1.1 ]

getPosition(): OfficeExtension.ClientResult<Visio.Position>;
Returns
OfficeExtension.ClientResult<Visio.Position>

getSelection()

Represents the Selection in the page.

[ API set: 1.1 ]

getSelection(): Visio.Selection;
Returns

isShapeInViewport(Shape)

To check if the shape is in view of the page or not.

[ API set: 1.1 ]

isShapeInViewport(Shape: Visio.Shape): OfficeExtension.ClientResult<boolean>;
Parameters
Shape
Visio.Shape

Shape to be checked.

Returns
OfficeExtension.ClientResult<boolean>

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

load(option?: string | string[]): Visio.PageView;
Parameters
option
string | string[]

A comma-delimited string or an array of strings that specify the properties to load.

Returns
Remarks

In addition to this signature, this method has the following signatures:

load(option?: { select?: string; expand?: string; }): Visio.PageView - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load.

load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Visio.PageView - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items.

Examples

Visio.run(session, function (ctx) {
    var activePage = ctx.document.getActivePage();
    activePage.view.zoom = 300;
    return ctx.sync();
}).catch(function(error) {
    console.log("Error: " + error);
    if (error instanceof OfficeExtension.Error) {
        console.log("Debug info: " + JSON.stringify(error.debugInfo));
    }
});

setPosition(Position)

Sets the position of the page in the view.

[ API set: 1.1 ]

setPosition(Position: Visio.Position): void;
Parameters
Position
Visio.Position

Position object that specifies the new position of the page in the view.

Returns
void

toJSON()

toJSON(): Visio.Interfaces.PageViewData;
Returns