SvgImageOptions
SvgImageOptions class
Options for generating Svg image.
class SvgImageOptions extends ImageOrPrintOptions;
Constructors
Name | Description |
---|---|
constructor() | Ctor. |
constructor(ImageOrPrintOptions) | Constructs from a parent object convertible to this. |
Properties
Property | Type | Description |
---|---|---|
fitToViewPort | boolean | if this property is true, the generated svg will fit to view port. |
cssPrefix | string | Gets and sets the prefix of the css name in svg,the default value is empty string. |
embeddedFontType | SvgEmbeddedFontType | Gets or sets the type of font that embedded in Svg. |
printWithStatusDialog | boolean | If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show. |
horizontalResolution | number | Gets or sets the horizontal resolution for generated images, in dots per inch. |
verticalResolution | number | Gets or sets the vertical resolution for generated images, in dots per inch. |
tiffCompression | TiffCompression | Gets or sets the type of compression to apply only when saving pages to the |
tiffColorDepth | ColorDepth | Gets or sets bit depth to apply only when saving pages to the |
tiffBinarizationMethod | ImageBinarizationMethod | Gets or sets method used while converting images to 1 bpp format when ImageType is Tiff and TiffCompression is equal to Ccitt3 or Ccitt4. |
printingPage | PrintingPageType | Indicates which pages will not be printed. |
quality | number | Gets or sets a value determining the quality of the generated images to apply only when saving pages to the |
onePagePerSheet | boolean | 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. |
allColumnsInOnePagePerSheet | boolean | 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. |
drawObjectEventHandler | DrawObjectEventHandler | Implements this interface to get DrawObject and Bound when rendering. |
embededImageNameInSvg | string | Indicate the filename of embedded image in svg. This should be full path with directory like “c:\xpsEmbedded” |
sVGFitToViewPort | boolean | if this property is true, the generated svg will fit to view port. |
svgCssPrefix | string | Gets and sets the prefix of the css name in svg,the default value is empty string. |
onlyArea | boolean | If this property is true , one Area will be output, and no scale will take effect. |
transparent | boolean | Indicates if the background of generated image should be transparent. |
warningCallback | IWarningCallback | Gets or sets warning callback. |
pageSavingCallback | IPageSavingCallback | Control/Indicate progress of page saving process. |
isFontSubstitutionCharGranularity | boolean | Indicates whether to only substitute the font of character when the cell font is not compatibility for it. |
pageIndex | number | Gets or sets the 0-based index of the first page to save. |
pageCount | number | Gets or sets the number of pages to save. |
isOptimized | boolean | Indicates whether to optimize the output elements. |
defaultFont | string | 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. |
checkWorkbookDefaultFont | boolean | 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. |
outputBlankPageWhenNothingToPrint | boolean | Indicates whether to output a blank page when there is nothing to print. |
gridlineType | GridlineType | Gets or sets gridline type. |
gridlineColor | Color | Gets or sets gridline colr. |
textCrossType | TextCrossType | Gets or sets displaying text type when the text width is larger than cell width. |
defaultEditLanguage | DefaultEditLanguage | Gets or sets default edit language. |
sheetSet | SheetSet | Gets or sets the sheets to render. Default is all visible sheets in the workbook: Aspose.Cells.Rendering.SheetSet.Visible. |
emfRenderSetting | EmfRenderSetting | Setting for rendering Emf metafiles in source file. |
customRenderSettings | CustomRenderSettings | Gets or sets custom settings during rendering. |
Methods
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
obj | ImageOrPrintOptions | The 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.
verticalResolution
Gets or sets the vertical resolution for generated images, in dots per inch.
verticalResolution : number;
Remarks
ara>The default value is 96.
tiffCompression
Gets or sets the type of compression to apply only when saving pages to the
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
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
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:
Parameter | Type | Description |
---|---|---|
desiredWidth | number | desired width in pixels |
desiredHeight | number | desired height in pixels |
keepAspectRatio | boolean | whether 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.
getImageType()
Gets or sets the format of the generated images. default value: PNG.
getImageType() : ImageType;
Returns
setImageType(ImageType)
Gets or sets the format of the generated images. default value: PNG.
setImageType(value: ImageType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | ImageType | The value to set. |