Class SvgSaveOptions

Class SvgSaveOptions

Namespace: Aspose.Words.Saving
Assembly: Aspose.Words.dll (25.3.0)

Can be used to specify additional options when saving a document into the Aspose.Words.SaveFormat.Svg format.

To learn more, visit the Specify Save Options documentation article.

public class SvgSaveOptions : FixedPageSaveOptions

Inheritance

objectSaveOptionsFixedPageSaveOptionsSvgSaveOptions

Inherited Members

FixedPageSaveOptions.Equals(object), FixedPageSaveOptions.AssertValidIdPrefix(string), FixedPageSaveOptions.IsValidIdPrefix(string), FixedPageSaveOptions.PageSet, FixedPageSaveOptions.PageSavingCallback, FixedPageSaveOptions.NumeralFormat, FixedPageSaveOptions.MetafileRenderingOptions, FixedPageSaveOptions.JpegQuality, FixedPageSaveOptions.ColorMode, FixedPageSaveOptions.OptimizeOutput, SaveOptions.CreateSaveOptions(SaveFormat), SaveOptions.CreateSaveOptions(string), SaveOptions.SaveFormat, SaveOptions.ExportGeneratorName, SaveOptions.TempFolder, SaveOptions.PrettyFormat, SaveOptions.UseAntiAliasing, SaveOptions.UseHighQualityRendering, SaveOptions.DmlRenderingMode, SaveOptions.DmlEffectsRenderingMode, SaveOptions.ImlRenderingMode, SaveOptions.DefaultTemplate, SaveOptions.UpdateFields, SaveOptions.UpdateLastSavedTimeProperty, SaveOptions.UpdateLastPrintedProperty, SaveOptions.UpdateCreatedTimeProperty, SaveOptions.MemoryOptimization, SaveOptions.UpdateAmbiguousTextFont, SaveOptions.Dml3DEffectsRenderingMode, SaveOptions.ProgressCallback, SaveOptions.AllowEmbeddingPostScriptFonts, SaveOptions.CustomTimeZoneInfo, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

SvgSaveOptions()

public SvgSaveOptions()

Properties

ExportEmbeddedImages

Specifies whether images should be embedded into the SVG document as base64. Be aware that activating this option can lead to a significant increase in the size of the output SVG file.

public bool ExportEmbeddedImages { get; set; }

Property Value

bool

FitToViewPort

Specifies if the output SVG should fill the available viewport area (browser window or container). When set to true width and height of output SVG are set to 100%.

The default value is false.

public bool FitToViewPort { get; set; }

Property Value

bool

IdPrefix

Specifies a prefix that is prepended to all generated element IDs in the output document. Default value is null and no prefix is prepended.

public string IdPrefix { get; set; }

Property Value

string

Remarks

If the prefix is specified, it can contain only letters, digits, underscores, and hyphens, and must start with a letter.

Exceptions

ArgumentException

The value does not meet the requirements specified above.

MaxImageResolution

Gets or sets a value in pixels per inch that limits resolution of exported raster images. Default value is zero.

public int MaxImageResolution { get; set; }

Property Value

int

Remarks

If the value of this property is non-zero, it limits resolution of exported raster images. That is, higher-resolution images are resampled down to the limit and lower-resolution images are exported as is.

If the value of this property is zero, all raster images are exported without resampling.

RemoveJavaScriptFromLinks

Specifies whether JavaScript will be removed from links. Default is false. If this option is enabled, all links containing JavaScript will be replaced with “javascript:void(0)”.

public bool RemoveJavaScriptFromLinks { get; set; }

Property Value

bool

ResourceSavingCallback

Allows to control how resources (images) are saved when a document is exported to SVG format.

public IResourceSavingCallback ResourceSavingCallback { get; set; }

Property Value

IResourceSavingCallback

ResourcesFolder

Specifies the physical folder where resources (images) are saved when exporting a document to Svg format. Default is null.

public string ResourcesFolder { get; set; }

Property Value

string

Remarks

Has effect only if Aspose.Words.Saving.SvgSaveOptions.ExportEmbeddedImages property is false.

When you save a Aspose.Words.Document in SVG format, Aspose.Words needs to save all images embedded in the document as standalone files. Aspose.Words.Saving.SvgSaveOptions.ResourcesFolder allows you to specify where the images will be saved and Aspose.Words.Saving.SvgSaveOptions.ResourcesFolderAlias allows to specify how the image URIs will be constructed.

If you save a document into a file and provide a file name, Aspose.Words, by default, saves the images in the same folder where the document file is saved. Use Aspose.Words.Saving.SvgSaveOptions.ResourcesFolder to override this behavior.

If you save a document into a stream, Aspose.Words does not have a folder where to save the images, but still needs to save the images somewhere. In this case, you need to specify an accessible folder in the Aspose.Words.Saving.SvgSaveOptions.ResourcesFolder property

Aspose.Words.Saving.SvgSaveOptions.ResourcesFolderAlias

ResourcesFolderAlias

Specifies the name of the folder used to construct image URIs written into an SVG document. Default is null.

public string ResourcesFolderAlias { get; set; }

Property Value

string

Remarks

When you save a Aspose.Words.Document in SVG format, Aspose.Words needs to save all images embedded in the document as standalone files. Aspose.Words.Saving.SvgSaveOptions.ResourcesFolder allows you to specify where the images will be saved and Aspose.Words.Saving.SvgSaveOptions.ResourcesFolderAlias allows to specify how the image URIs will be constructed.

Aspose.Words.Saving.SvgSaveOptions.ResourcesFolder

SaveFormat

Specifies the format in which the document will be saved if this save options object is used. Can only be Aspose.Words.SaveFormat.Svg.

public override SaveFormat SaveFormat { get; set; }

Property Value

SaveFormat

ShowPageBorder

Controls whether a border is added to the outline of the page. Default is true.

public bool ShowPageBorder { get; set; }

Property Value

bool

TextOutputMode

Gets or sets a value determining how text should be rendered in SVG.

public SvgTextOutputMode TextOutputMode { get; set; }

Property Value

SvgTextOutputMode

Remarks

Use this property to get or set the mode of how text inside a document should be rendered when saving in SVG format.

The default value is Aspose.Words.Saving.SvgTextOutputMode.UseTargetMachineFonts.