public class SvgOptions extends ImageOptionsBase
The SVG file format creation options.
Constructor and Description |
---|
SvgOptions() |
Modifier and Type | Method and Description |
---|---|
ISvgResourceKeeperCallback |
getCallback()
Gets or sets the font store options.
|
int |
getColorType()
Gets or sets the color type for SVG image.
|
boolean |
getTextAsShapes()
Gets or sets a value indicating whether text must be converted as shapes.
|
void |
setCallback(ISvgResourceKeeperCallback value)
Gets or sets the font store options.
|
void |
setColorType(int value)
Gets or sets the color type for SVG image.
|
void |
setTextAsShapes(boolean value)
Gets or sets a value indicating whether text must be converted as shapes.
|
deepClone, getBufferSizeHint, getMultiPageOptions, getPalette, getResolutionSettings, getSource, getVectorRasterizationOptions, getXmpData, setBufferSizeHint, setMultiPageOptions, setPalette, setResolutionSettings, setSource, setVectorRasterizationOptions, setXmpData
close, dispose, getDisposed
public int getColorType()
Gets or sets the color type for SVG image.
public void setColorType(int value)
Gets or sets the color type for SVG image.
value
- The type of the color of SVG image.public boolean getTextAsShapes()
Gets or sets a value indicating whether text must be converted as shapes.
true
if all text is turned into SVG shapes in the convertion; otherwise, false
.public void setTextAsShapes(boolean value)
Gets or sets a value indicating whether text must be converted as shapes.
value
- true
if all text is turned into SVG shapes in the convertion; otherwise, false
.This example shows how to load a EMF image from a file and convert it to SVG using EmfRasterizationOptions.
String dir = "c:\\temp\\"; // Using Aspose.Imaging.Image.Load is a unified way to load all types of images including EMF. com.aspose.imaging.fileformats.emf.EmfImage emfImage = (com.aspose.imaging.fileformats.emf.EmfImage) com.aspose.imaging.Image.load(dir + "test.emf"); try { com.aspose.imaging.imageoptions.SvgOptions saveOptions = new com.aspose.imaging.imageoptions.SvgOptions(); // Text will be converted to shapes. saveOptions.setTextAsShapes(true); com.aspose.imaging.imageoptions.EmfRasterizationOptions rasterizationOptions = new com.aspose.imaging.imageoptions.EmfRasterizationOptions(); // The background color of the drawing surface. rasterizationOptions.setBackgroundColor(com.aspose.imaging.Color.getWhiteSmoke()); // The page size. rasterizationOptions.setPageSize(new com.aspose.imaging.SizeF(emfImage.getWidth(), emfImage.getHeight())); // If embedded emf exists, then render emf; otherwise render wmf. rasterizationOptions.setRenderMode(com.aspose.imaging.fileformats.emf.EmfRenderMode.Auto); // Set the horizontal margin rasterizationOptions.setBorderX(50); // Set the vertical margin rasterizationOptions.setBorderY(50); saveOptions.setVectorRasterizationOptions(rasterizationOptions); emfImage.save(dir + "test.output.svg", saveOptions); } finally { emfImage.dispose(); }
public ISvgResourceKeeperCallback getCallback()
Gets or sets the font store options.
public void setCallback(ISvgResourceKeeperCallback value)
Gets or sets the font store options.
value
- The font store options.Copyright (c) 2008-2019 Aspose Pty Ltd. All Rights Reserved.