Click or drag to resize

getPage Method

Gets a value representing the parent PdfPage Class of this PdfObject instance.

Syntax
JavaScript
function getPage();

Parameters

None

Return Value

Type: PdfPage Class

Returns the parent page.

Remarks

This method will return the parent page of this PdfObject Class.

Examples
The following example uses the ObjectEventArgs Class to handle the "objectAdded" event of the PdfWebControlApi Class.
JavaScript
//declare event handler function (which accepts an object of type ObjectAddedEventArgs as an argument)
function objectAddedHandler(evt)
{
    //declare object properties to set
    var props = 
        {
            "top" : 0, //set to top
            "height" : evt.obj.getPage().getHeight() //set height to height of page
        };

    //set properties
    evt.obj.setProperties(props);
}

//get API class
var myApi = new PdfWebControlApi("PdfWebControl1"); // where "PdfWebControl1" is the ID (ClientID) assigned to the PdfWebControl instance

//attach event handler to objectAdded event
myApi.addEventListener("objectAdded", objectAddedHandler);
See Also