SvgOptions.TextAsShapes
Contents
[
Hide
]SvgOptions.TextAsShapes property
Gets or sets a value indicating whether text must be rendered as shapes.
public bool TextAsShapes { get; set; }
Property Value
true
if all text is turned into SVG shapes in the convertion; otherwise, false
.
Examples
This example shows how to load a WMF image from a file and convert it to SVG using WmfRasterizationOptions.
[C#]
string dir = "c:\\temp\\";
// Using Aspose.Imaging.Image.Load is a unified way to load all types of images including WMF.
using (Aspose.Imaging.FileFormats.Wmf.WmfImage wmfImage = (Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir + "test.wmf"))
{
Aspose.Imaging.ImageOptions.SvgOptions saveOptions = new Aspose.Imaging.ImageOptions.SvgOptions();
// Text will be converted to shapes.
saveOptions.TextAsShapes = true;
Aspose.Imaging.ImageOptions.WmfRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.WmfRasterizationOptions();
// The background color of the drawing surface.
rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.WhiteSmoke;
// The page size.
rasterizationOptions.PageSize = wmfImage.Size;
// If embedded emf exists, then render emf; otherwise render wmf.
rasterizationOptions.RenderMode = Aspose.Imaging.FileFormats.Wmf.WmfRenderMode.Auto;
saveOptions.VectorRasterizationOptions = rasterizationOptions;
wmfImage.Save(dir + "test.output.svg", saveOptions);
}
This example shows how to load a EMF image from a file and convert it to SVG using EmfRasterizationOptions.
[C#]
string dir = "c:\\temp\\";
// Using Aspose.Imaging.Image.Load is a unified way to load all types of images including EMF.
using (Aspose.Imaging.FileFormats.Emf.EmfImage emfImage = (Aspose.Imaging.FileFormats.Emf.EmfImage)Aspose.Imaging.Image.Load(dir + "test.emf"))
{
Aspose.Imaging.ImageOptions.SvgOptions saveOptions = new Aspose.Imaging.ImageOptions.SvgOptions();
// Text will be converted to shapes.
saveOptions.TextAsShapes = true;
Aspose.Imaging.ImageOptions.EmfRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.EmfRasterizationOptions();
// The background color of the drawing surface.
rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.WhiteSmoke;
// The page size.
rasterizationOptions.PageSize = emfImage.Size;
// If embedded emf exists, then render emf; otherwise render wmf.
rasterizationOptions.RenderMode = Aspose.Imaging.FileFormats.Emf.EmfRenderMode.Auto;
// Set the horizontal margin
rasterizationOptions.BorderX = 50;
// Set the vertical margin
rasterizationOptions.BorderY = 50;
saveOptions.VectorRasterizationOptions = rasterizationOptions;
emfImage.Save(dir + "test.output.svg", saveOptions);
}
See Also
- class SvgOptions
- namespace Aspose.Imaging.ImageOptions
- assembly Aspose.Imaging