ImageGear.Web.UI Namespace Client API Library > ImageGear.Web.UI Namespace > ImGearDocument class : ImGearDocument Constructor |
ASP.NET Ajax Javascript (Specification) | |
---|---|
ImageGear.Web.UI.ImGearDocument = function() {}; |
ASP.NET Ajax Javascript (Usage) | |
---|---|
var instanceVar = new ImageGear.Web.UI.ImGearDocument(); |
An ImGearDocument object can be created by passing input parameter object, refer to the ImageGear.Web.UI.ImGearDocumentCreateArgs with properties documentidentifier, encodedDocumentidentifier and imageServicePath.
An ImGearDocument can also be created by including other ImGearDocument properties in the constructor parameter object, namely, includeAllpages. The pages information can also be specified with an array containing the page numbers or range of pages to be included. It is not strictly necessary to create ImageGear.Web.UI.ImGearDocumentCreateArgs object. An in-line parameter object can be passed at the creation time as shown in the following examples:
Example 1
In this example, an ImGearDocument object is created by providing the documentIdentifier and the imageServicePath in the parameter object:
var newDocument = new ImageGear.Web.UI.ImGearDocument ({documentIdentifier: “MyImage.tif”, imageServicePath:”imageService”});
Example 2
In this example, an ImGearDocument object is created by providing the documentIdentifier, imageServicePath and a page array in the parameter object:
var newDocument = new ImageGear.Web.UI.ImGearDocument ({documentIdentifier: “MyImage.tif”, imageServicePath:”imageService”,pages:{2,5,7,10}});
Example 3
In this example, an ImGearDocument object is created by providing the documentIdentifier, imageServicePath and page range in the parameter object. The page range start page is specified with pageNumber and the pageRangeCount is the count of pages in the range. In this example the start page number is 5 and the last page is 14. The page count index in a multi-page file index always starts from 0:
var newDocument = new ImageGear.Web.UI.ImGearDocument ({documentIdentifier: “MyImage.tif”, imageServicePath:”imageService”,pageNumber:5,pagerangeCount:10});
Note: It is not necessary to provide both encodedDocumentIdentifier and the documentIdentifier. Either one would suffice. But if both are provided and they do not match, an exception will be thrown.