SvgImageOptions

SvgImageOptions class

Options for generating Svg image.

class SvgImageOptions extends ImageOrPrintOptions;

Constructors

NameDescription
constructor()Ctor.
constructor(ImageOrPrintOptions)Constructs from a parent object convertible to this.

Properties

PropertyTypeDescription
fitToViewPortbooleanif this property is true, the generated svg will fit to view port.
cssPrefixstringGets and sets the prefix of the css name in svg,the default value is empty string.
embeddedFontTypeSvgEmbeddedFontTypeGets or sets the type of font that embedded in Svg.
printWithStatusDialogbooleanIf PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.
horizontalResolutionnumberGets or sets the horizontal resolution for generated images, in dots per inch.
verticalResolutionnumberGets or sets the vertical resolution for generated images, in dots per inch.
tiffCompressionTiffCompressionGets or sets the type of compression to apply only when saving pages to the Tiff format.
tiffColorDepthColorDepthGets or sets bit depth to apply only when saving pages to the Tiff format.
tiffBinarizationMethodImageBinarizationMethodGets or sets method used while converting images to 1 bpp format when ImageType is Tiff and TiffCompression is equal to Ccitt3 or Ccitt4.
printingPagePrintingPageTypeIndicates which pages will not be printed.
qualitynumberGets or sets a value determining the quality of the generated images to apply only when saving pages to the Jpeg format. The default value is 100
onePagePerSheetbooleanIf OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.
allColumnsInOnePagePerSheetbooleanIf AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The width of paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.
drawObjectEventHandlerDrawObjectEventHandlerImplements this interface to get DrawObject and Bound when rendering.
embededImageNameInSvgstringIndicate the filename of embedded image in svg. This should be full path with directory like “c:\xpsEmbedded”
sVGFitToViewPortbooleanif this property is true, the generated svg will fit to view port.
svgCssPrefixstringGets and sets the prefix of the css name in svg,the default value is empty string.
onlyAreabooleanIf this property is true , one Area will be output, and no scale will take effect.
transparentbooleanIndicates if the background of generated image should be transparent.
warningCallbackIWarningCallbackGets or sets warning callback.
pageSavingCallbackIPageSavingCallbackControl/Indicate progress of page saving process.
isFontSubstitutionCharGranularitybooleanIndicates whether to only substitute the font of character when the cell font is not compatibility for it.
pageIndexnumberGets or sets the 0-based index of the first page to save.
pageCountnumberGets or sets the number of pages to save.
isOptimizedbooleanIndicates whether to optimize the output elements.
defaultFontstringWhen characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set the DefaultFont such as MingLiu or MS Gothic to show these characters. If this property is not set, Aspose.Cells will use system default font to show these unicode characters.
checkWorkbookDefaultFontbooleanWhen characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set this to true to try to use workbook’s default font to show these characters first.
outputBlankPageWhenNothingToPrintbooleanIndicates whether to output a blank page when there is nothing to print.
gridlineTypeGridlineTypeGets or sets gridline type.
gridlineColorColorGets or sets gridline colr.
textCrossTypeTextCrossTypeGets or sets displaying text type when the text width is larger than cell width.
defaultEditLanguageDefaultEditLanguageGets or sets default edit language.
sheetSetSheetSetGets or sets the sheets to render. Default is all visible sheets in the workbook: Aspose.Cells.Rendering.SheetSet.Visible.
emfRenderSettingEmfRenderSettingSetting for rendering Emf metafiles in source file.
customRenderSettingsCustomRenderSettingsGets or sets custom settings during rendering.

Methods

MethodDescription
setDesiredSize(number, number, boolean)Sets desired width and height of image.
getImageType()Gets or sets the format of the generated images. default value: PNG.
setImageType(ImageType)Gets or sets the format of the generated images. default value: PNG.

constructor()

Ctor.

constructor();

constructor(ImageOrPrintOptions)

Constructs from a parent object convertible to this.

constructor(obj: ImageOrPrintOptions);

Parameters:

ParameterTypeDescription
objImageOrPrintOptionsThe parent object.

fitToViewPort

if this property is true, the generated svg will fit to view port.

fitToViewPort : boolean;

cssPrefix

Gets and sets the prefix of the css name in svg,the default value is empty string.

cssPrefix : string;

embeddedFontType

Gets or sets the type of font that embedded in Svg.

embeddedFontType : SvgEmbeddedFontType;

Remarks

Default value is SvgEmbeddedFontType.None which indicates that it will not embed font in Svg.

printWithStatusDialog

If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.

printWithStatusDialog : boolean;

horizontalResolution

Gets or sets the horizontal resolution for generated images, in dots per inch.

horizontalResolution : number;

Remarks

ara>The default value is 96. Setting HorizontalResolution and VerticalResolution effects the width and height of the output image in pixels.</para

verticalResolution

Gets or sets the vertical resolution for generated images, in dots per inch.

verticalResolution : number;

Remarks

ara>The default value is 96. Setting HorizontalResolution and VerticalResolution effects the width and height of the output image in pixels.</para

tiffCompression

Gets or sets the type of compression to apply only when saving pages to the Tiff format.

tiffCompression : TiffCompression;

Remarks

Has effect only when saving to TIFF. The default value is Lzw.

tiffColorDepth

Gets or sets bit depth to apply only when saving pages to the Tiff format.

tiffColorDepth : ColorDepth;

Remarks

Has effect only when saving to TIFF. If TiffCompression is set to CCITT3, CCITT4, this will not take effect, the bit depth of the generated tiff image will be always 1.

tiffBinarizationMethod

Gets or sets method used while converting images to 1 bpp format when ImageType is Tiff and TiffCompression is equal to Ccitt3 or Ccitt4.

tiffBinarizationMethod : ImageBinarizationMethod;

Remarks

The default value is FloydSteinbergDithering.

printingPage

Indicates which pages will not be printed.

printingPage : PrintingPageType;

quality

Gets or sets a value determining the quality of the generated images to apply only when saving pages to the Jpeg format. The default value is 100

quality : number;

Remarks

Has effect only when saving to JPEG. The value must be between 0 and 100. The default value is 100.

onePagePerSheet

If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.

onePagePerSheet : boolean;

allColumnsInOnePagePerSheet

If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The width of paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.

allColumnsInOnePagePerSheet : boolean;

drawObjectEventHandler

Implements this interface to get DrawObject and Bound when rendering.

drawObjectEventHandler : DrawObjectEventHandler;

embededImageNameInSvg

Indicate the filename of embedded image in svg. This should be full path with directory like “c:\xpsEmbedded”

embededImageNameInSvg : string;

Remarks

NOTE: This member is now obsolete. Instead, please remove this property because images are now always embedded in Svg with base64 format. This property will be removed 12 months later since April 2025. Aspose apologizes for any inconvenience you may have experienced.

sVGFitToViewPort

if this property is true, the generated svg will fit to view port.

sVGFitToViewPort : boolean;

Remarks

NOTE: This member is now obsolete. Instead, please use SvgImageOptions.FitToViewPort. This property will be removed 12 months later since April 2025. Aspose apologizes for any inconvenience you may have experienced.

svgCssPrefix

Gets and sets the prefix of the css name in svg,the default value is empty string.

svgCssPrefix : string;

Remarks

NOTE: This member is now obsolete. Instead, please use SvgImageOptions.CssPrefix. This property will be removed 12 months later since April 2025. Aspose apologizes for any inconvenience you may have experienced.

onlyArea

If this property is true , one Area will be output, and no scale will take effect.

onlyArea : boolean;

transparent

Indicates if the background of generated image should be transparent.

transparent : boolean;

Remarks

The default value is false. That means the background of the generated images is white.

warningCallback

Gets or sets warning callback.

warningCallback : IWarningCallback;

pageSavingCallback

Control/Indicate progress of page saving process.

pageSavingCallback : IPageSavingCallback;

isFontSubstitutionCharGranularity

Indicates whether to only substitute the font of character when the cell font is not compatibility for it.

isFontSubstitutionCharGranularity : boolean;

Remarks

Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.

pageIndex

Gets or sets the 0-based index of the first page to save.

pageIndex : number;

Remarks

Default is 0.

pageCount

Gets or sets the number of pages to save.

pageCount : number;

Remarks

Default is System.Int32.MaxValue which means all pages will be rendered.

isOptimized

Indicates whether to optimize the output elements.

isOptimized : boolean;

Remarks

Default value is false. Currently when this property is set to true, the following optimizations will be done: 1. optimize the border lines. 2. optimize the file size while rendering to Svg image.

defaultFont

When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set the DefaultFont such as MingLiu or MS Gothic to show these characters. If this property is not set, Aspose.Cells will use system default font to show these unicode characters.

defaultFont : string;

checkWorkbookDefaultFont

When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set this to true to try to use workbook’s default font to show these characters first.

checkWorkbookDefaultFont : boolean;

Remarks

Default is true.

outputBlankPageWhenNothingToPrint

Indicates whether to output a blank page when there is nothing to print.

outputBlankPageWhenNothingToPrint : boolean;

Remarks

Default is false.

gridlineType

Gets or sets gridline type.

gridlineType : GridlineType;

Remarks

Default is Dotted type.

gridlineColor

Gets or sets gridline colr.

gridlineColor : Color;

Remarks

It will ignore the gridline color settings in the source file.

textCrossType

Gets or sets displaying text type when the text width is larger than cell width.

textCrossType : TextCrossType;

defaultEditLanguage

Gets or sets default edit language.

defaultEditLanguage : DefaultEditLanguage;

Remarks

It may display/render different layouts for text paragraph when different edit languages is set. Default is Aspose.Cells.DefaultEditLanguage.Auto.

sheetSet

Gets or sets the sheets to render. Default is all visible sheets in the workbook: Aspose.Cells.Rendering.SheetSet.Visible.

sheetSet : SheetSet;

Remarks

The set is ignored when it is used in SheetRender

emfRenderSetting

Setting for rendering Emf metafiles in source file.

emfRenderSetting : EmfRenderSetting;

Remarks

EMF metafiles identified as “EMF+ Dual” can contain both EMF+ records and EMF records. Either type of record can be used to render the image, only EMF+ records, or only EMF records. When Aspose.Cells.EmfRenderSetting.EmfPlusPrefer is set, then EMF+ records will be parsed while rendering to image, otherwise only EMF records will be parsed. Default value is Aspose.Cells.EmfRenderSetting.EmfOnly. For the frameworks that depend on .Net System.Drawing.Common, this setting is ignored.

customRenderSettings

Gets or sets custom settings during rendering.

customRenderSettings : CustomRenderSettings;

setDesiredSize(number, number, boolean)

Sets desired width and height of image.

setDesiredSize(desiredWidth: number, desiredHeight: number, keepAspectRatio: boolean) : void;

Parameters:

ParameterTypeDescription
desiredWidthnumberdesired width in pixels
desiredHeightnumberdesired height in pixels
keepAspectRatiobooleanwhether to keep aspect ratio of origin image

Remarks

ara>The width and height of the output image in pixels will be only based on the set desired width and height. The HorizontalResolution and VerticalResolution will not effect the width and height of the output image in this case.</para

getImageType()

Gets or sets the format of the generated images. default value: PNG.

getImageType() : ImageType;

Returns

ImageType

setImageType(ImageType)

Gets or sets the format of the generated images. default value: PNG.

setImageType(value: ImageType) : void;

Parameters:

ParameterTypeDescription
valueImageTypeThe value to set.