ImageOrPrintOptions

ImageOrPrintOptions class

Allows to specify options when rendering worksheet to images, printing worksheet or rendering chart to image.

new ImageOrPrintOptions()

Methods

NameDescription
getAllColumnsInOnePagePerSheet()If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The wid
getChartImageType()Indicate the chart imagetype when converting. default value: PNG. NOTE: This member is now obsolete. Instead, Chart and
getCheckWorkbookDefaultFont()When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf
getCustomRenderSettings()
getDefaultEditLanguage()Gets or sets default edit language. The value of the property is DefaultEditLanguage integer constant. It may display/re
getDefaultFont()When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf
getDrawObjectEventHandler()Implements this interface to get DrawObject and Bound when rendering.
getEmbededImageNameInSvg()Indicate the filename of embedded image in svg. This should be full path with directory like “c:\xpsEmbedded”
getEmfRenderSetting()Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. EMF metafiles identi
getGridlineColor()
getGridlineType()Gets or sets gridline type. The value of the property is GridlineType integer constant. Default is Dotted type.
getHorizontalResolution()Gets or sets the horizontal resolution for generated images, in dots per inch. Applies generating image method except Em
getImageType()Gets or sets the format of the generated images. default value: PNG. The value of the property is ImageType integer cons
getOnePagePerSheet()If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetu
getOnlyArea()If this property is true , one Area will be output, and no scale will take effect.
getOutputBlankPageWhenNothingToPrint()Indicates whether to output a blank page when there is nothing to print. Default is false.
getPageCount()Gets or sets the number of pages to save. Default is System.Int32.MaxValue which means all pages will be rendered.
getPageIndex()Gets or sets the 0-based index of the first page to save. Default is 0.
getPageSavingCallback()Control/Indicate progress of page saving process.
getPrintWithStatusDialog()If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.
getPrintingPage()Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.
getQuality()Gets or sets a value determining the quality of the generated images to apply only when saving pages to the Jpeg format.
getSVGFitToViewPort()if this property is true, the generated svg will fit to view port.
getSaveFormat()Gets or sets the output file format type Support Tiff/XPS The value of the property is SaveFormat integer constant. NOTE
getSheetSet()Gets or sets the sheets to render. Default is all visible sheets in the workbook: SheetSet.Visible. The set is ignored w
getSvgCssPrefix()
getTextCrossType()Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossT
getTiffColorDepth()Gets or sets bit depth to apply only when saving pages to the Tiff format. The value of the property is ColorDepth integ
getTiffCompression()Gets or sets the type of compression to apply only when saving pages to the Tiff format. The value of the property is Ti
getTiffPhotometricInterpretation()Gets the type of PhotometricInterpretation to apply only when saving pages to the Tiff format. Has effect only when savi
getTransparent()Indicates if the background of generated image should be transparent. The default value is false. That means the backgro
getVerticalResolution()Gets or sets the vertical resolution for generated images, in dots per inch. Applies generating image method except Emf
isCellAutoFit()Indicates whether the width and height of the cells is automatically fitted by cell value. The default value is false. N
isFontSubstitutionCharGranularity()Indicates whether to only substitute the font of character when the cell font is not compatibility for it. Default is fa
isOptimized()Indicates whether to optimize the output elements. Default value is false. Currently when this property is set to true,
setAllColumnsInOnePagePerSheet()If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The wid
setCellAutoFit()Indicates whether the width and height of the cells is automatically fitted by cell value. The default value is false. N
setChartImageType()Indicate the chart imagetype when converting. default value: PNG. NOTE: This member is now obsolete. Instead, Chart and
setCheckWorkbookDefaultFont()When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf
setCustomRenderSettings()
setDefaultEditLanguage()Gets or sets default edit language. The value of the property is DefaultEditLanguage integer constant. It may display/re
setDefaultFont()When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf
setDesiredSize(desiredWidth, desiredHeight)Sets desired width and height of image. NOTE: This member is now obsolete. Instead, please use setDesiredSize(int, int,
setDesiredSize(desiredWidth, desiredHeight, keepAspectRatio)Sets desired width and height of image.
setDrawObjectEventHandler()Implements this interface to get DrawObject and Bound when rendering.
setEmbededImageNameInSvg()Indicate the filename of embedded image in svg. This should be full path with directory like “c:\xpsEmbedded”
setEmfRenderSetting()Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. EMF metafiles identi
setFontSubstitutionCharGranularity()Indicates whether to only substitute the font of character when the cell font is not compatibility for it. Default is fa
setGridlineColor()
setGridlineType()Gets or sets gridline type. The value of the property is GridlineType integer constant. Default is Dotted type.
setHorizontalResolution()Gets or sets the horizontal resolution for generated images, in dots per inch. Applies generating image method except Em
setImageType()Gets or sets the format of the generated images. default value: PNG. The value of the property is ImageType integer cons
setOnePagePerSheet()If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetu
setOnlyArea()If this property is true , one Area will be output, and no scale will take effect.
setOptimized()Indicates whether to optimize the output elements. Default value is false. Currently when this property is set to true,
setOutputBlankPageWhenNothingToPrint()Indicates whether to output a blank page when there is nothing to print. Default is false.
setPageCount()Gets or sets the number of pages to save. Default is System.Int32.MaxValue which means all pages will be rendered.
setPageIndex()Gets or sets the 0-based index of the first page to save. Default is 0.
setPageSavingCallback()Control/Indicate progress of page saving process.
setPrintWithStatusDialog()If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.
setPrintingPage()Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.
setQuality()Gets or sets a value determining the quality of the generated images to apply only when saving pages to the Jpeg format.
setRenderingHint(key, value)Sets the value of a single preference for the rendering algorithms. Hint categories include controls for rendering quali
setSVGFitToViewPort()if this property is true, the generated svg will fit to view port.
setSaveFormat()Gets or sets the output file format type Support Tiff/XPS The value of the property is SaveFormat integer constant. NOTE
setSheetSet()Gets or sets the sheets to render. Default is all visible sheets in the workbook: SheetSet.Visible. The set is ignored w
setSvgCssPrefix()
setTextCrossType()Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossT
setTiffColorDepth()Gets or sets bit depth to apply only when saving pages to the Tiff format. The value of the property is ColorDepth integ
setTiffCompression()Gets or sets the type of compression to apply only when saving pages to the Tiff format. The value of the property is Ti
setTiffPhotometricInterpretation()Sets the type of PhotometricInterpretation to apply only when saving pages to the Tiff format. Has effect only when savi
setTransparent()Indicates if the background of generated image should be transparent. The default value is false. That means the backgro
setVerticalResolution()Gets or sets the vertical resolution for generated images, in dots per inch. Applies generating image method except Emf

getAllColumnsInOnePagePerSheet()

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.

getChartImageType()

Indicate the chart imagetype when converting. default value: PNG. NOTE: This member is now obsolete. Instead, Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality. This property will be removed 12 months later since June 2022. Aspose apologizes for any inconvenience you may have experienced.

getCheckWorkbookDefaultFont()

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. Default is true.

getCustomRenderSettings()

getDefaultEditLanguage()

Gets or sets default edit language. The value of the property is DefaultEditLanguage integer constant. It may display/render different layouts for text paragraph when different edit languages is set. Default is DefaultEditLanguage.AUTO.

getDefaultFont()

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.

getDrawObjectEventHandler()

Implements this interface to get DrawObject and Bound when rendering.

getEmbededImageNameInSvg()

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

getEmfRenderSetting()

Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. 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 EmfRenderSetting.EMF_PLUS_PREFER is set, then EMF+ records will be parsed while rendering to image, otherwise only EMF records will be parsed. Default value is EmfRenderSetting.EMF_ONLY. For the frameworks that depend on .Net System.Drawing.Common, this setting is ignored.

getGridlineColor()

getGridlineType()

Gets or sets gridline type. The value of the property is GridlineType integer constant. Default is Dotted type.

getHorizontalResolution()

Gets or sets the horizontal resolution for generated images, in dots per inch. Applies generating image method except Emf format images. The default value is 96.

getImageType()

Gets or sets the format of the generated images. default value: PNG. The value of the property is ImageType integer constant.

getOnePagePerSheet()

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.

getOnlyArea()

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

getOutputBlankPageWhenNothingToPrint()

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

getPageCount()

Gets or sets the number of pages to save. Default is System.Int32.MaxValue which means all pages will be rendered.

getPageIndex()

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

getPageSavingCallback()

Control/Indicate progress of page saving process.

getPrintWithStatusDialog()

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

getPrintingPage()

Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.

getQuality()

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 Has effect only when saving to JPEG. The value must be between 0 and 100. The default value is 100.

getSVGFitToViewPort()

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

getSaveFormat()

Gets or sets the output file format type Support Tiff/XPS The value of the property is SaveFormat integer constant. NOTE: This member is now obsolete. Instead, For Tiff/Svg, use ImageType; For Xps, use Workbook.save(java.lang.String, com.aspose.cells.SaveOptions) with XpsSaveOptions. This property will be removed 12 months later since August 2022. Aspose apologizes for any inconvenience you may have experienced.

getSheetSet()

Gets or sets the sheets to render. Default is all visible sheets in the workbook: SheetSet.Visible. The set is ignored when it is used in SheetRender

getSvgCssPrefix()

getTextCrossType()

Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossType integer constant.

getTiffColorDepth()

Gets or sets bit depth to apply only when saving pages to the Tiff format. The value of the property is ColorDepth integer constant. 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.

getTiffCompression()

Gets or sets the type of compression to apply only when saving pages to the Tiff format. The value of the property is TiffCompression integer constant. Has effect only when saving to TIFF. The default value is Lzw.

getTiffPhotometricInterpretation()

Gets the type of PhotometricInterpretation to apply only when saving pages to the Tiff format. Has effect only when saving to TIFF. The default value is -1, represent no PhotometricInterpretation is applied.

getTransparent()

Indicates if the background of generated image should be transparent. The default value is false. That means the background of the generated images is white.

getVerticalResolution()

Gets or sets the vertical resolution for generated images, in dots per inch. Applies generating image method except Emf format image. The default value is 96.

isCellAutoFit()

Indicates whether the width and height of the cells is automatically fitted by cell value. The default value is false. NOTE: This member is now obsolete. Instead, please use Worksheet.autoFitColumns(com.aspose.cells.AutoFitterOptions) and Worksheet.autoFitRows(com.aspose.cells.AutoFitterOptions). This property will be removed 12 months later since August 2022. Aspose apologizes for any inconvenience you may have experienced.

isFontSubstitutionCharGranularity()

Indicates whether to only substitute the font of character when the cell font is not compatibility for it. Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.

isOptimized()

Indicates whether to optimize the output elements. Default value is false. Currently when this property is set to true, the following optimizations will be done:

setAllColumnsInOnePagePerSheet()

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.

setCellAutoFit()

Indicates whether the width and height of the cells is automatically fitted by cell value. The default value is false. NOTE: This member is now obsolete. Instead, please use Worksheet.autoFitColumns(com.aspose.cells.AutoFitterOptions) and Worksheet.autoFitRows(com.aspose.cells.AutoFitterOptions). This property will be removed 12 months later since August 2022. Aspose apologizes for any inconvenience you may have experienced.

setChartImageType()

Indicate the chart imagetype when converting. default value: PNG. NOTE: This member is now obsolete. Instead, Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality. This property will be removed 12 months later since June 2022. Aspose apologizes for any inconvenience you may have experienced.

setCheckWorkbookDefaultFont()

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. Default is true.

setCustomRenderSettings()

setDefaultEditLanguage()

Gets or sets default edit language. The value of the property is DefaultEditLanguage integer constant. It may display/render different layouts for text paragraph when different edit languages is set. Default is DefaultEditLanguage.AUTO.

setDefaultFont()

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.

setDesiredSize(desiredWidth, desiredHeight)

Sets desired width and height of image. NOTE: This member is now obsolete. Instead, please use setDesiredSize(int, int, boolean) by setting param keepAspectRatio to false. This property will be removed 12 months later since May 2023. Aspose apologizes for any inconvenience you may have experienced.

ParameterTypeDescription
desiredWidthNumberdesired width in pixels
desiredHeightNumberdesired height in pixels

setDesiredSize(desiredWidth, desiredHeight, keepAspectRatio)

Sets desired width and height of image.

ParameterTypeDescription
desiredWidthNumberdesired width in pixels
desiredHeightNumberdesired height in pixels
keepAspectRatiobooleanwhether to keep aspect ratio of origin image

setDrawObjectEventHandler()

Implements this interface to get DrawObject and Bound when rendering.

setEmbededImageNameInSvg()

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

setEmfRenderSetting()

Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. 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 EmfRenderSetting.EMF_PLUS_PREFER is set, then EMF+ records will be parsed while rendering to image, otherwise only EMF records will be parsed. Default value is EmfRenderSetting.EMF_ONLY. For the frameworks that depend on .Net System.Drawing.Common, this setting is ignored.

setFontSubstitutionCharGranularity()

Indicates whether to only substitute the font of character when the cell font is not compatibility for it. Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.

setGridlineColor()

setGridlineType()

Gets or sets gridline type. The value of the property is GridlineType integer constant. Default is Dotted type.

setHorizontalResolution()

Gets or sets the horizontal resolution for generated images, in dots per inch. Applies generating image method except Emf format images. The default value is 96.

setImageType()

Gets or sets the format of the generated images. default value: PNG. The value of the property is ImageType integer constant.

setOnePagePerSheet()

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.

setOnlyArea()

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

setOptimized()

Indicates whether to optimize the output elements. Default value is false. Currently when this property is set to true, the following optimizations will be done:

setOutputBlankPageWhenNothingToPrint()

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

setPageCount()

Gets or sets the number of pages to save. Default is System.Int32.MaxValue which means all pages will be rendered.

setPageIndex()

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

setPageSavingCallback()

Control/Indicate progress of page saving process.

setPrintWithStatusDialog()

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

setPrintingPage()

Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.

setQuality()

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 Has effect only when saving to JPEG. The value must be between 0 and 100. The default value is 100.

setRenderingHint(key, value)

Sets the value of a single preference for the rendering algorithms. Hint categories include controls for rendering quality and overall time/quality trade-off in the rendering process. Refer to the RenderingHints class for definitions of some common keys and values.

ParameterTypeDescription
keyKeythe key of the hint to be set.
valueObjectthe value indicating preferences for the specified hint category.

setSVGFitToViewPort()

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

setSaveFormat()

Gets or sets the output file format type Support Tiff/XPS The value of the property is SaveFormat integer constant. NOTE: This member is now obsolete. Instead, For Tiff/Svg, use ImageType; For Xps, use Workbook.save(java.lang.String, com.aspose.cells.SaveOptions) with XpsSaveOptions. This property will be removed 12 months later since August 2022. Aspose apologizes for any inconvenience you may have experienced.

setSheetSet()

Gets or sets the sheets to render. Default is all visible sheets in the workbook: SheetSet.Visible. The set is ignored when it is used in SheetRender

setSvgCssPrefix()

setTextCrossType()

Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossType integer constant.

setTiffColorDepth()

Gets or sets bit depth to apply only when saving pages to the Tiff format. The value of the property is ColorDepth integer constant. 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.

setTiffCompression()

Gets or sets the type of compression to apply only when saving pages to the Tiff format. The value of the property is TiffCompression integer constant. Has effect only when saving to TIFF. The default value is Lzw.

setTiffPhotometricInterpretation()

Sets the type of PhotometricInterpretation to apply only when saving pages to the Tiff format. Has effect only when saving to TIFF. The default value is -1, represent no PhotometricInterpretation is applied.

setTransparent()

Indicates if the background of generated image should be transparent. The default value is false. That means the background of the generated images is white.

setVerticalResolution()

Gets or sets the vertical resolution for generated images, in dots per inch. Applies generating image method except Emf format image. The default value is 96.