In This Topic
Saving drawings in NOV Diagram is done by calling one of the Save... method overloads of the NDrawingView class or the drawing format you want to save to.
The supported drawing formats are exposed as static properties of the NDrawingFormat class, for example: NDrawingFormat.NevronBinary, NDrawingFormat.Visio and so on. For a list of all supported drawing formats open the Diagram File Formats Overview topic.
Save to File or Stream Directly
-
Save to a Nevron Binary Drawing file synchronously
To save synchronously to a Nevron Binary Drawing local file call the SaveToLocalFile method of the drawing view. This method doesn't work on sandboxed platforms like Blazor WebAssembly.
|
Copy Code
|
drawingView.SaveToLocalFile(@"D:\Documents\MyDrawing.ndb");
|
-
Save to a Nevron Binary Drawing file asynchronously
To save a drawing to a file asynchronously call the SaveToFileAsync method of the drawing view. Calling this method shows a loader over the drawing view until the saving completes. The method returns a promise, which you can use to get notified when the saving completes.
|
Copy Code
|
drawingView.SaveToFileAsync(@"D:\Documents\MyDrawing.ndb").Then(
delegate (bool success)
{
},
delegate (Exception ex)
{
}
);
|
-
Save to a Nevron Binary Drawing stream using a drawing view
To save a drawing to a stream call the SaveToStream method of the drawing view and pass the drawing format to save to:
|
Copy Code
|
drawingView.SaveToStream(stream, NDrawingFormat.NevronBinary);
|
-
Save a drawing document to a Nevron Binary Drawing stream directly
To save a drawing to a stream directly, without using a drawing view, call the SaveToStream method of the drawing format you want to save to:
|
Copy Code
|
NDrawingFormat.NevronBinary.SaveToStream(drawingDocument, stream);
|
Show a Save File Dialog
To show the standard Save File dialog, use the SaveAsAsync method:
Save File dialog |
Copy Code
|
drawingView.SaveAsAsync();
|
If you want a specific format to be selected by default, pass it as an argument:
Save File dialog with a specific file format selected |
Copy Code
|
drawingView.SaveAsAsync(NDrawingFormat.NevronBinary);
|
See Also