







JsPropertiesExtractor | Send comments on this topic. |
MergeDocument Method | |
See Also Example |
![]() |
vdWebLibrary Namespace > vdrawObj Class : MergeDocument Method |
- filename
- Required. A filename url
- finishCallback
- Optional. If present and not is null represents a user function callback to be fired when merge finished
- mergeFlags
- Optional. If present must be one of MERGEFLAGS_DEFAULT , MERGEFLAGS_REPLACE_EXISITING. Represents FLags that control how the merge is done.If not present MERGEFLAGS_DEFAULT is used.
- blobstr
- Optional.If present and not is null represents the contents of filename that used to be loaded instead of downlonding the paseed filename.
JScript | |
---|---|
public function MergeDocument( filename : String, finishCallback : MergeDocumentFinshedDelegate, mergeFlags : int, blobstr : String ); |
Parameters
- filename
- Required. A filename url
- finishCallback
- Optional. If present and not is null represents a user function callback to be fired when merge finished
- mergeFlags
- Optional. If present must be one of MERGEFLAGS_DEFAULT , MERGEFLAGS_REPLACE_EXISITING. Represents FLags that control how the merge is done.If not present MERGEFLAGS_DEFAULT is used.
- blobstr
- Optional.If present and not is null represents the contents of filename that used to be loaded instead of downlonding the paseed filename.
User add a new layer and a new line and we and merge them later on a basic drawing.
You can open the drawing 'basic.vds' (The layer 'user' is empty)
Add some entities to layer 'user'
Partial save only the entities from layer 'user' (using entity.excludeFromSave = true; to all other entities) as 'user.vds'
Then
Open the drawing 'basic.vds' (The layer 'user' is empty)
Call the vdcanvas.MergeDocument('user.vds',mergedocumentfinished, vdConst.MERGEFLAGS_DEFAULT, partialSavedFileData);
The entities of Model of the 'user.vds' will be added to existing document Model entities.
This method will only work for entities that come from a Document A and are going to be loaded to Document A again.
It will not work for entities from a Different drawing.
Suppose that in the HTML page we have five buttons.
Button 1.OpenBasic -> Load a basic.vds file which contains a circle,an ellipse,a text,a rectangle and a spline.
Button 2.Line -> Creates a new layer and a new line.
Button 3.Save -> Save the new layer and line in a virtual user.vds which is actually not exists
Button 4.reOpenBasic -> Reopens the basic.vds without the new layer and new line.
Button 5.Merge -> Merge the basic.vds with the user.vds where we previous added some new entities.
C# | ![]() |
---|---|
var vdcanvas; |
The passed document must have been saved using the parsial save using excludeFromSave add the currently selected document must be the same as the document when partial save of passed document done.
This is useful to use a main drawing as background. Let the user add some 'annotation' entities on specific layer, then partial save only entities of that layer.
Later you can open the background drawing and use the MergeDocument with previous partial saved document to show the user annotation entities over the background drawing.