save method

save(fileName, saveOptions)

Renders the shape into an image and saves into a file.

save(fileName: string, saveOptions: Aspose.Words.Saving.ImageSaveOptions)
ParameterTypeDescription
fileNamestringThe name for the image file. If a file with the specified name already exists, the existing file is overwritten.
saveOptionsImageSaveOptionsSpecifies the options that control how the shape is rendered and saved. Can be null.

save(fileName, saveOptions)

Renders the shape into an SVG image and saves into a file.

save(fileName: string, saveOptions: Aspose.Words.Saving.SvgSaveOptions)
ParameterTypeDescription
fileNamestringThe name for the image file. If a file with the specified name already exists, the existing file is overwritten.
saveOptionsSvgSaveOptionsSpecifies the options that control how the shape is rendered and saved. Can be null.

save(stream, saveOptions)

Renders the shape into an image and saves into a stream.

save(stream: Buffer, saveOptions: Aspose.Words.Saving.ImageSaveOptions)
ParameterTypeDescription
streamBufferThe stream where to save the image of the shape.
saveOptionsImageSaveOptionsSpecifies the options that control how the shape is rendered and saved. Can be null. If this is null, the image will be saved in the PNG format.

save(stream, saveOptions)

Renders the shape into an SVG image and saves into a stream.

save(stream: Buffer, saveOptions: Aspose.Words.Saving.SvgSaveOptions)
ParameterTypeDescription
streamBufferThe stream where to save the SVG image of the shape.
saveOptionsSvgSaveOptionsSpecifies the options that control how the shape is rendered and saved. Can be null. If this is null, the image will be saved with the default options.

Examples

Shows how to render an Office Math object into an image file in the local file system.

let doc = new aw.Document(base.myDir + "Office math.docx");

let officeMath = doc.getOfficeMath(0, true);

// Create an "ImageSaveOptions" object to pass to the node renderer's "Save" method to modify
// how it renders the OfficeMath node into an image.
let saveOptions = new aw.Saving.ImageSaveOptions(aw.SaveFormat.Png);

// Set the "Scale" property to 5 to render the object to five times its original size.
saveOptions.scale = 5;

officeMath.getMathRenderer().save(base.artifactsDir + "Shape.RenderOfficeMath.png", saveOptions);

Shows how to pass save options when rendering office math.

let doc = new aw.Document(base.myDir + "Office math.docx");

let math = doc.getOfficeMath(0, true);

let options = new aw.Saving.SvgSaveOptions();
options.textOutputMode = aw.Saving.SvgTextOutputMode.UsePlacedGlyphs;

math.getMathRenderer().save(base.artifactsDir + "SvgSaveOptions.Output.svg", options);

See Also