Table of Contents

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

fileName string

The destination file path where the document will be saved. The method attempts to write the document contents to this file.

Returns

bool

true if the save operation completed successfully; otherwise false.

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

fileName string

The destination filename where the document will be saved.

PreviewImage Image

An optional Image to be stored as the file preview. Pass null if no preview is required.

version string

The 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

true if the save operation completed successfully; otherwise false.

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

fileName string

Destination filename including extension. Must not be null or empty.

PreviewImage Image

Optional preview Image to be stored with the saved file. If null and the active layout has a render memory bitmap, that bitmap will be used as the preview image.

Returns

bool

true if the save operation completed successfully; otherwise false. When returning false a 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 false and an error is reported via RaiseGenericError(string, string).
See Also