getObjectCount Method |
Gets the number of objects on this page of the currently loaded document.
function getObjectCount();
None
Type: Integer
The number of objects on this page.This method only returns the number of objects on this page. To access objects on a different page, use that page's PdfPage Class.
var myApi = new PdfWebControlApi("PdfWebControl1"); // where "PdfWebControl1" is the ID (ClientID) assigned to the PdfWebControl instance //get this page var page = myApi.getPageViewed(); //get the number of objects on this page var objCount = page.getObjectCount(); //iterate through all objects on this page for(var i = 0; i < objCount; i++) { //get this object var obj = page.getObject(i); //if it is a form field, display its name to the user if(obj.isFormField()) { window.alert("Found a form field with the name: " + obj.getProperties()["name"]); } }