Method SaveAs
- Namespace
- VectorDraw.Professional.vdObjects
- Assembly
- VectorDraw.Professional.dll
SaveAs(string)
Saves the current document to the specified file path.
public bool SaveAs(string fileName)
Parameters
fileNamestringThe destination file path where the document will be saved. The method attempts to write the document contents to this file.
Returns
- bool
trueif the save operation completed successfully; otherwisefalse.
Remarks
This overload delegates to SaveAs(string, Image) providing null
for the preview image.
- See Also
SaveAs(string, Image, string)
Saves the document to the specified fileName using the provided preview image
and forcing the specified version for the save operation.
public bool SaveAs(string fileName, Image PreviewImage, string version)
Parameters
fileNamestringThe destination filename where the document will be saved.
PreviewImageImageAn optional Image to be stored as the file preview. Pass
nullif no preview is required.versionstringThe version identifier to use while saving the document. The document's current Version is temporarily replaced with this value for the duration of the save operation.
Returns
- bool
trueif the save operation completed successfully; otherwisefalse.
Remarks
The method temporarily sets the document's Version to the supplied version and then
calls the primary SaveAs(string, Image) overload. If the save fails, the original
Version value is restored before returning false.
- See Also
SaveAs(string, Image)
Saves the document to the specified file path. Optionally embeds a preview image into the saved file. The method supports native VectorDraw serialized formats (".vdml" and ".vdcl") and other export formats (dwg dgn dxf vds pdf ifc skp stl dwf dae obj ply svg hpg wmf emf jpg bmp png) via ExportToFile(string).
public bool SaveAs(string fileName, Image PreviewImage)
Parameters
fileNamestringDestination filename including extension. Must not be
nullor empty.PreviewImageImageOptional preview Image to be stored with the saved file. If
nulland the active layout has a render memory bitmap, that bitmap will be used as the preview image.
Returns
- bool
trueif the save operation completed successfully; otherwisefalse. When returningfalsea generic error is raised via RaiseGenericError(string, string) with an appropriate message.
Remarks
- If the target extension is not a native VectorDraw format, the call delegates to ExportToFile(string).
- For ".vdml" the document is serialized without compression; for ".vdcl" compression is applied according to CompressionMethod.
- On successful save the document's (FileName) is updated and IsModified is set to
false. - Serialization exceptions are caught inside the method; callers receive
falseand an error is reported via RaiseGenericError(string, string).
- See Also