aspose.cells
Class ImageOrPrintOptions

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

Example:

$options = new cells\ImageOrPrintOptions();
//set Horizontal resolution
$options->setHorizontalResolution(200);
//set Vertica; Resolution
$options->setVerticalResolution(300);

//Instantiate Workbook
$workbook = new cells\Workbook();
$cells = $workbook->getWorksheets()->get(0)->getCells();
$cells->get("a1")->putValue(2);
$cells->get("a2")->putValue(5);
$cells->get("a3")->putValue(3);
$cells->get("a4")->putValue(6);
$cells->get("b1")->putValue(4);
$cells->get("b2")->putValue(3);
$cells->get("b3")->putValue(6);
$cells->get("b4")->putValue(7);
$chartIndex = $workbook->getWorksheets()->get(0)->getCharts()->add(cells\ChartType::COLUMN, 11, 0, 27, 10);
$chart = $workbook->getWorksheets()->get(0)->getCharts()->get($chartIndex);
$chart->getNSeries()->add("A1:B4", true);
//Save chart as Image using ImageOrPrint Options
$chart->toImage("res.png", $options);

Constructor Summary
ImageOrPrintOptions()
          
 
Property Getters/Setters Summary
functiongetAllColumnsInOnePagePerSheet()
functionsetAllColumnsInOnePagePerSheet(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.
functiongetChartImageType()
functionsetChartImageType(value)
           Indicate the chart imagetype when converting.
functiongetCheckWorkbookDefaultFont()
functionsetCheckWorkbookDefaultFont(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.
functiongetDefaultEditLanguage()
functionsetDefaultEditLanguage(value)
           Gets or sets default edit language. The value of the property is DefaultEditLanguage integer constant.
functiongetDefaultFont()
functionsetDefaultFont(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.
functiongetDrawObjectEventHandler()
functionsetDrawObjectEventHandler(value)
           Implements this interface to get DrawObject and Bound when rendering.
functiongetEmbededImageNameInSvg()
functionsetEmbededImageNameInSvg(value)
           Indicate the filename of embedded image in svg. This should be full path with directory like "c:\\xpsEmbedded"
functiongetGridlineType()
functionsetGridlineType(value)
           Gets or sets gridline type. The value of the property is GridlineType integer constant.
functiongetHorizontalResolution()
functionsetHorizontalResolution(value)
           Gets or sets the horizontal resolution for generated images, in dots per inch. Applies generating image method except Emf format images.
functiongetImageFormat()
functionsetImageFormat(value)
           Gets or sets the format of the generated images. Don't apply the method that returns a Bitmap object.
functiongetImageType()
functionsetImageType(value)
           Gets or sets the format of the generated images. Don't apply the method that returns a Bitmap object. The value of the property is ImageType integer constant.
functionisCellAutoFit()
functionsetCellAutoFit(value)
           Indicates whether the width and height of the cells is automatically fitted by cell value. The default value is false.
functionisFontSubstitutionCharGranularity()
functionsetFontSubstitutionCharGranularity(value)
           Indicates whether only substitute the font of character when the cell font is not compatibility for it.
functionisImageFitToPage()
functionsetImageFitToPage(value)
           When set the value to true, the page only include the cells that have data. The default value is false.
functiongetOnePagePerSheet()
functionsetOnePagePerSheet(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.
functiongetOnlyArea()
functionsetOnlyArea(value)
           If this property is true , one Area will be output, and no scale will take effect.
functiongetOutputBlankPageWhenNothingToPrint()
functionsetOutputBlankPageWhenNothingToPrint(value)
           Indicates whether to output a blank page when there is nothing to print.
functiongetPageCount()
functionsetPageCount(value)
           Gets or sets the number of pages to save.
functiongetPageIndex()
functionsetPageIndex(value)
           Gets or sets the 0-based index of the first page to save.
functiongetPageSavingCallback()
functionsetPageSavingCallback(value)
           Control/Indicate progress of page saving process.
functiongetPrintingPage()
functionsetPrintingPage(value)
           Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.
functiongetPrintWithStatusDialog()
functionsetPrintWithStatusDialog(value)
           If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.
functiongetQuality()
functionsetQuality(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
functiongetSaveFormat()
functionsetSaveFormat(value)
           Gets or sets the output file format type Support Tiff/XPS The value of the property is SaveFormat integer constant.
functiongetSVGFitToViewPort()
functionsetSVGFitToViewPort(value)
           if this property is true, the generated svg will fit to view port.
functiongetTextCrossType()
functionsetTextCrossType(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.
functiongetTiffColorDepth()
functionsetTiffColorDepth(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.
functiongetTiffCompression()
functionsetTiffCompression(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.
functiongetTransparent()
functionsetTransparent(value)
           Indicates if the background of generated image should be transparent.
functiongetVerticalResolution()
functionsetVerticalResolution(value)
           Gets or sets the vertical resolution for generated images, in dots per inch. Applies generating image method except Emf format image.
 
Method Summary
functionsetDesiredSize(desiredWidth, desiredHeight)
           Sets desired width and height of image.
 

Constructor Detail

ImageOrPrintOptions

function ImageOrPrintOptions()

Property Getters/Setters Detail

getSaveFormat/setSaveFormat : Number 

function getSaveFormat() / function 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 

function getPrintWithStatusDialog() / function setPrintWithStatusDialog(value)
If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.

getHorizontalResolution/setHorizontalResolution : Number 

function getHorizontalResolution() / function 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 : Number 

function getVerticalResolution() / function 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 : Number 

function getTiffCompression() / function 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 : Number 

function getTiffColorDepth() / function 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 : Number 

function getPrintingPage() / function setPrintingPage(value)
Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.

getQuality/setQuality : Number 

function getQuality() / function 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 

function getImageFormat() / function setImageFormat(value)
Gets or sets the format of the generated images. Don't apply the method that returns a Bitmap object. 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 : Number 

function getImageType() / function setImageType(value)
Gets or sets the format of the generated images. Don't apply the method that returns a Bitmap object. The value of the property is ImageType integer constant. The default value is ImageFormat.Bmp. Don't apply the method that returns a Bitmap object.

isCellAutoFit/setCellAutoFit : boolean 

function isCellAutoFit() / function 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 

function isImageFitToPage() / function 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 

function getOnePagePerSheet() / function 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 

function getAllColumnsInOnePagePerSheet() / function 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 

function getDrawObjectEventHandler() / function setDrawObjectEventHandler(value)
Implements this interface to get DrawObject and Bound when rendering.

getChartImageType/setChartImageType : ImageFormat 

function getChartImageType() / function setChartImageType(value)
Indicate the chart imagetype when converting.

getEmbededImageNameInSvg/setEmbededImageNameInSvg : String 

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

getSVGFitToViewPort/setSVGFitToViewPort : boolean 

function getSVGFitToViewPort() / function setSVGFitToViewPort(value)
if this property is true, the generated svg will fit to view port.

getOnlyArea/setOnlyArea : boolean 

function getOnlyArea() / function setOnlyArea(value)
If this property is true , one Area will be output, and no scale will take effect.

getTransparent/setTransparent : boolean 

function getTransparent() / function 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 

function getPageSavingCallback() / function setPageSavingCallback(value)
Control/Indicate progress of page saving process.

isFontSubstitutionCharGranularity/setFontSubstitutionCharGranularity : boolean 

function isFontSubstitutionCharGranularity() / function setFontSubstitutionCharGranularity(value)
Indicates whether 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 : Number 

function getPageIndex() / function setPageIndex(value)
Gets or sets the 0-based index of the first page to save. Default is 0.

getPageCount/setPageCount : Number 

function getPageCount() / function setPageCount(value)
Gets or sets the number of pages to save. Default is System.Int32.MaxValue which means all pages will be rendered..

getDefaultFont/setDefaultFont : String 

function getDefaultFont() / function 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 

function getCheckWorkbookDefaultFont() / function 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 

function getOutputBlankPageWhenNothingToPrint() / function setOutputBlankPageWhenNothingToPrint(value)
Indicates whether to output a blank page when there is nothing to print. Default is false.

getGridlineType/setGridlineType : Number 

function getGridlineType() / function setGridlineType(value)
Gets or sets gridline type. The value of the property is GridlineType integer constant. Default is Dotted type.

getTextCrossType/setTextCrossType : Number 

function getTextCrossType() / function 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 : Number 

function getDefaultEditLanguage() / function 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

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

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.