Method SetDocument
- Namespace
- vdWebLibrary
- Assembly
- JsPropertiesExtractor.dll
SetDocument(object)
Select a document object that previous was store into a variable by the GetDocument()
public bool SetDocument(object documentObject)
Parameters
documentObjectobject
Returns
- bool
True is the passed documentObject was successfully selected.
Examples
//A document that selected in vectordraw canvas using the vdcanvas.SelectDocument(filename) can be stored in memory and loaded later as follow
var vdcanvas = vdmanager.vdrawObject('canvas');
vdcanvas.SelectDocument('PathFilename.vds');
vdcanvas.vdAfterOpenDocument = _vdAfterOpenDocument;
var documentdata = null;//global variable that reference to a selected document
function _vdAfterOpenDocument(vdcanvas)
{
//WARNING you can access the document only in the vdAfterOpenDocument event
documentdata = vdcanvas.GetDocument();//set active selected document to a global variable
var documentPathName = document.pathname;//return the full path name of the selected document
}
function LoadFromDocumentReference()
{
//fast select a document that already is in memory
vdcanvas.SetDocument(documentdata);
setTimeout(vdcanvas.redraw, 0);//post redraw for new selected document
}