SvgOptions Class
Contents
[
Hide
]Summary: Create Scalar Vector Graphics (SVG) image files with our API, utilizing versatile
options for color types and compression levels. Seamlessly customize your
SVG images with precision, ensuring optimal quality and compatibility for your design needs.
Module: aspose.imaging.imageoptions
Full Name: aspose.imaging.imageoptions.SvgOptions
Inheritance: IHasXmpData, IHasMetadata, ImageOptionsBase
Constructors
Name | Description |
---|---|
SvgOptions() | Initializes a new instance of the SvgOptions. |
Properties
Name | Type | Access | Description |
---|---|---|---|
buffer_size_hint | int | r/w | Gets or sets the buffer size hint which is defined max allowed size for all internal buffers. |
callback | ISvgResourceKeeperCallback | r/w | Gets or sets the storing strategy for embedded resousces of SvgImage such as fonts, nested rasters. |
color_type | SvgColorMode | r/w | Gets or sets the color type for SVG image. |
compress | bool | r/w | Gets or sets a value indicating whether the output image must to be compressed. |
disposed | bool | r | Gets a value indicating whether this instance is disposed. |
full_frame | bool | r/w | Gets or sets a value indicating whether [full frame]. |
keep_metadata | bool | r/w | Gets a value whether to keep original image metadata on export. |
multi_page_options | MultiPageOptions | r/w | The multipage options |
palette | IColorPalette | r/w | Gets or sets the color palette. |
resolution_settings | ResolutionSetting | r/w | Gets or sets the resolution settings. |
source | Source | r/w | Gets or sets the source to create image in. |
text_as_shapes | bool | r/w | Gets or sets a value indicating whether text must be rendered as shapes. |
vector_rasterization_options | VectorRasterizationOptions | r/w | Gets or sets the vector rasterization options. |
xmp_data | XmpPacketWrapper | r/w | Gets or sets the XMP metadata container. |
Methods
Name | Description |
---|---|
clone() | Creates a memberwise clone of this instance. |
Constructor: SvgOptions()
SvgOptions()
Initializes a new instance of the SvgOptions.
Property: text_as_shapes
Gets or sets a value indicating whether text must be rendered as shapes.
See also:
Example # 1: This example shows how to load a WMF image from a file and convert it to SVG …
Method: clone()
clone()
Creates a memberwise clone of this instance.
Returns
Type | Description |
---|---|
ImageOptionsBase | A memberwise clone of this instance. |
Examples
This example shows how to load a WMF image from a file and convert it to SVG using WmfRasterizationOptions.
from aspose.pycore import as_of, cast
from aspose.imaging import Image, Color, SizeF
from aspose.imaging.fileformats.wmf import WmfImage, WmfRenderMode
from aspose.imaging.imageoptions import SvgOptions, WmfRasterizationOptions
# Using Aspose.Imaging.Image.Load is a unified way to load all types of images including WMF.
with as_of(Image.load("test.wmf") as image:
saveOptions = SvgOptions()
# Text will be converted to shapes.
saveOptions.text_as_shapes = True
rasterizationOptions = WmfRasterizationOptions()
# The background color of the drawing surface.
rasterizationOptions.background_color = Color.white_smoke
# The page size.
rasterizationOptions.page_size = cast(SizeF, wmfImage.size)
# If embedded emf exists, then render emf; otherwise render wmf.
rasterizationOptions.render_mode = WmfRenderMode.AUTO
saveOptions.vector_rasterization_options = rasterizationOptions
wmfImage.save("test.output.svg", saveOptions)