asposecells.api

Class ImageOrPrintOptions

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

Example:

# Set Image Or Print Options
options = ImageOrPrintOptions()
# set Horizontal resolution
options.setHorizontalResolution(200)
# set Vertica Resolution
options.setVerticalResolution(300)

# Instantiate Workbook
book = Workbook("Book2.xlsx")
# Save chart as Image using ImageOrPrint Options
book.getWorksheets().get(3).getCharts().get(0).toImage("chart.png", options)

Constructor Summary
 
Property Getters/Setters Summary
methodgetAllColumnsInOnePagePerSheet()
method
           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.
methodgetChartImageType()
method
           Indicate the chart imagetype when converting. default value: PNG.
methodgetCheckWorkbookDefaultFont()
method
           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.
methodgetDefaultEditLanguage()
method
           Gets or sets default edit language. The value of the property is DefaultEditLanguage integer constant.
methodgetDefaultFont()
method
           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.
methodgetDrawObjectEventHandler()
method
           Implements this interface to get DrawObject and Bound when rendering.
methodgetEmbededImageNameInSvg()
method
           Indicate the filename of embedded image in svg. This should be full path with directory like "c:\\xpsEmbedded"
methodgetGridlineType()
method
           Gets or sets gridline type. The value of the property is GridlineType integer constant.
methodgetHorizontalResolution()
method
           Gets or sets the horizontal resolution for generated images, in dots per inch. Applies generating image method except Emf format images.
methodgetImageFormat()
method
           Gets or sets the format of the generated images.
methodgetImageType()
method
           Gets or sets the format of the generated images. default value: PNG. The value of the property is ImageType integer constant.
methodisCellAutoFit()
method
           Indicates whether the width and height of the cells is automatically fitted by cell value. The default value is false.
methodisFontSubstitutionCharGranularity()
method
           Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
methodisImageFitToPage()
method
           When set the value to true, the page only include the cells that have data. The default value is false.
methodisOptimized()
method
           Indicates whether to optimize the output elements.
methodgetOnePagePerSheet()
method
           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.
methodgetOnlyArea()
method
           If this property is true , one Area will be output, and no scale will take effect.
methodgetOutputBlankPageWhenNothingToPrint()
method
           Indicates whether to output a blank page when there is nothing to print.
methodgetPageCount()
method
           Gets or sets the number of pages to save.
methodgetPageIndex()
method
           Gets or sets the 0-based index of the first page to save.
methodgetPageSavingCallback()
method
           Control/Indicate progress of page saving process.
methodgetPrintingPage()
method
           Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.
methodgetPrintWithStatusDialog()
method
           If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.
methodgetQuality()
method
setQuality(value)
           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
methodgetSaveFormat()
method
           Gets or sets the output file format type Support Tiff/XPS The value of the property is SaveFormat integer constant.
methodgetSVGFitToViewPort()
method
           if this property is true, the generated svg will fit to view port.
methodgetTextCrossType()
method
           Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossType integer constant.
methodgetTiffColorDepth()
method
           Gets or sets bit depth to apply only when saving pages to the Tiff format. The value of the property is ColorDepth integer constant.
methodgetTiffCompression()
method
           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.
methodgetTransparent()
method
           Indicates if the background of generated image should be transparent.
methodgetVerticalResolution()
method
           Gets or sets the vertical resolution for generated images, in dots per inch. Applies generating image method except Emf format image.
 
Method Summary
methodsetDesiredSize(desiredWidth, desiredHeight)
Sets desired width and height of image.
 

    • Constructor Detail

      • ImageOrPrintOptions

        ImageOrPrintOptions()
    • Property Getters/Setters Detail

      • getSaveFormat/setSaveFormat : int 

        int getSaveFormat() / setSaveFormat(value)
        
        Gets or sets the output file format type Support Tiff/XPS The value of the property is SaveFormat integer constant.
      • getPrintWithStatusDialog/setPrintWithStatusDialog : boolean 

        boolean getPrintWithStatusDialog() / setPrintWithStatusDialog(value)
        
        If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.
      • getHorizontalResolution/setHorizontalResolution : int 

        int getHorizontalResolution() / setHorizontalResolution(value)
        
        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.
      • getVerticalResolution/setVerticalResolution : int 

        int getVerticalResolution() / setVerticalResolution(value)
        
        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.
      • getTiffCompression/setTiffCompression : int 

        int getTiffCompression() / setTiffCompression(value)
        
        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.
      • getTiffColorDepth/setTiffColorDepth : int 

        int getTiffColorDepth() / setTiffColorDepth(value)
        
        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.
      • getPrintingPage/setPrintingPage : int 

        int getPrintingPage() / setPrintingPage(value)
        
        Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.
      • getQuality/setQuality : int 

        int getQuality() / setQuality(value)
        
        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.
      • getImageFormat/setImageFormat : ImageFormat 

        ImageFormat getImageFormat() / setImageFormat(value)
        
        Gets or sets the format of the generated images. NOTE: This member is now obsolete. Instead, please use ImageOrPrintOptions.ImageType property. This property will be removed 12 months later since April. 2018. Aspose apologizes for any inconvenience you may have experienced.
      • getImageType/setImageType : int 

        int getImageType() / setImageType(value)
        
        Gets or sets the format of the generated images. default value: PNG. The value of the property is ImageType integer constant.
      • isCellAutoFit/setCellAutoFit : boolean 

        boolean isCellAutoFit() / setCellAutoFit(value)
        
        Indicates whether the width and height of the cells is automatically fitted by cell value. The default value is false.
      • isImageFitToPage/setImageFitToPage : boolean 

        boolean isImageFitToPage() / setImageFitToPage(value)
        
        When set the value to true, the page only include the cells that have data. The default value is false.
      • getOnePagePerSheet/setOnePagePerSheet : boolean 

        boolean getOnePagePerSheet() / setOnePagePerSheet(value)
        
        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.
      • getAllColumnsInOnePagePerSheet/setAllColumnsInOnePagePerSheet : boolean 

        boolean getAllColumnsInOnePagePerSheet() / setAllColumnsInOnePagePerSheet(value)
        
        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.
      • getDrawObjectEventHandler/setDrawObjectEventHandler : DrawObjectEventHandler 

        DrawObjectEventHandler getDrawObjectEventHandler() / setDrawObjectEventHandler(value)
        
        Implements this interface to get DrawObject and Bound when rendering.
      • getChartImageType/setChartImageType : ImageFormat 

        ImageFormat getChartImageType() / setChartImageType(value)
        
        Indicate the chart imagetype when converting. default value: PNG.
      • getEmbededImageNameInSvg/setEmbededImageNameInSvg : String 

        String getEmbededImageNameInSvg() / setEmbededImageNameInSvg(value)
        
        Indicate the filename of embedded image in svg. This should be full path with directory like "c:\\xpsEmbedded"
      • getSVGFitToViewPort/setSVGFitToViewPort : boolean 

        boolean getSVGFitToViewPort() / setSVGFitToViewPort(value)
        
        if this property is true, the generated svg will fit to view port.
      • getOnlyArea/setOnlyArea : boolean 

        boolean getOnlyArea() / setOnlyArea(value)
        
        If this property is true , one Area will be output, and no scale will take effect.
      • getTransparent/setTransparent : boolean 

        boolean getTransparent() / setTransparent(value)
        
        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.
      • getPageSavingCallback/setPageSavingCallback : IPageSavingCallback 

        IPageSavingCallback getPageSavingCallback() / setPageSavingCallback(value)
        
        Control/Indicate progress of page saving process.
      • isFontSubstitutionCharGranularity/setFontSubstitutionCharGranularity : boolean 

        boolean isFontSubstitutionCharGranularity() / setFontSubstitutionCharGranularity(value)
        
        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.
      • getPageIndex/setPageIndex : int 

        int getPageIndex() / setPageIndex(value)
        
        Gets or sets the 0-based index of the first page to save. Default is 0.
      • getPageCount/setPageCount : int 

        int getPageCount() / setPageCount(value)
        
        Gets or sets the number of pages to save. Default is System.Int32.MaxValue which means all pages will be rendered.
      • isOptimized/setOptimized : boolean 

        boolean isOptimized() / setOptimized(value)
        
        Indicates whether to optimize the output elements. Default value is false. Currently only the border lines are optimized when this property is set to true.
      • getDefaultFont/setDefaultFont : String 

        String getDefaultFont() / setDefaultFont(value)
        
        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.
      • getCheckWorkbookDefaultFont/setCheckWorkbookDefaultFont : boolean 

        boolean getCheckWorkbookDefaultFont() / setCheckWorkbookDefaultFont(value)
        
        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.
      • getOutputBlankPageWhenNothingToPrint/setOutputBlankPageWhenNothingToPrint : boolean 

        boolean getOutputBlankPageWhenNothingToPrint() / setOutputBlankPageWhenNothingToPrint(value)
        
        Indicates whether to output a blank page when there is nothing to print. Default is false.
      • getGridlineType/setGridlineType : int 

        int getGridlineType() / setGridlineType(value)
        
        Gets or sets gridline type. The value of the property is GridlineType integer constant. Default is Dotted type.
      • getTextCrossType/setTextCrossType : int 

        int getTextCrossType() / setTextCrossType(value)
        
        Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossType integer constant.
      • getDefaultEditLanguage/setDefaultEditLanguage : int 

        int getDefaultEditLanguage() / setDefaultEditLanguage(value)
        
        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 #Error Cref: !:DefaultEditLanguage.Auto.
    • Method Detail

      • setDesiredSize

         setDesiredSize(desiredWidth, desiredHeight)
        Sets desired width and height of image.
        Parameters:
        desiredWidth: int - desired width in pixels
        desiredHeight: int - desired height in pixels