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 |
---|
Property Getters/Setters Summary | ||
---|---|---|
function | getAllColumnsInOnePagePerSheet() | |
function | ||
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. | ||
function | getChartImageType() | |
function | setChartImageType(value) | |
Indicate the chart imagetype when converting. default value: PNG. | ||
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. | ||
function | getDefaultEditLanguage() | |
function | setDefaultEditLanguage(value) | |
Gets or sets default edit language. The value of the property is DefaultEditLanguage integer constant. | ||
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. | ||
function | getDrawObjectEventHandler() | |
function | setDrawObjectEventHandler(value) | |
Implements this interface to get DrawObject and Bound when rendering. | ||
function | getEmbededImageNameInSvg() | |
function | setEmbededImageNameInSvg(value) | |
Indicate the filename of embedded image in svg. This should be full path with directory like "c:\\xpsEmbedded" | ||
function | getEmfRenderSetting() | |
function | setEmfRenderSetting(value) | |
Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. | ||
function | getGridlineType() | |
function | setGridlineType(value) | |
Gets or sets gridline type. The value of the property is GridlineType integer constant. | ||
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. | ||
function | getImageType() | |
function | setImageType(value) | |
Gets or sets the format of the generated images. default value: PNG. The value of the property is ImageType integer constant. | ||
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. | ||
function | isFontSubstitutionCharGranularity() | |
function | ||
Indicates whether to only substitute the font of character when the cell font is not compatibility for it. | ||
function | isOptimized() | |
function | setOptimized(value) | |
Indicates whether to optimize the output elements. | ||
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. | ||
function | getOnlyArea() | |
function | setOnlyArea(value) | |
If this property is true , one Area will be output, and no scale will take effect. | ||
function | getOutputBlankPageWhenNothingToPrint() | |
function | ||
Indicates whether to output a blank page when there is nothing to print. | ||
function | getPageCount() | |
function | setPageCount(value) | |
Gets or sets the number of pages to save. | ||
function | getPageIndex() | |
function | setPageIndex(value) | |
Gets or sets the 0-based index of the first page to save. | ||
function | getPageSavingCallback() | |
function | setPageSavingCallback(value) | |
Control/Indicate progress of page saving process. | ||
function | getPrintingPage() | |
function | setPrintingPage(value) | |
Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant. | ||
function | getPrintWithStatusDialog() | |
function | setPrintWithStatusDialog(value) | |
If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show. | ||
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
|
||
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. | ||
function | getSheetSet() | |
function | setSheetSet(value) | |
Gets or sets the sheets to render. Default is all visible sheets in the workbook: |
||
function | getSVGFitToViewPort() | |
function | setSVGFitToViewPort(value) | |
if this property is true, the generated svg will fit to view port. | ||
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. | ||
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. |
||
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. |
||
function | getTransparent() | |
function | setTransparent(value) | |
Indicates if the background of generated image should be transparent. | ||
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. |
Method Summary | ||
---|---|---|
function | getTiffPhotometricInterpretation() | |
Gets the type of PhotometricInterpretation to apply only when saving pages to the Tiff format.
|
||
function | setDesiredSize(desiredWidth, desiredHeight) | |
Sets desired width and height of image.
|
||
function | setDesiredSize(desiredWidth, desiredHeight, keepAspectRatio) | |
Sets desired width and height of image.
|
||
function | 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.
|
||
function | setTiffPhotometricInterpretation(value) | |
Sets the type of PhotometricInterpretation to apply only when saving pages to the Tiff format.
|
function getSaveFormat() / function setSaveFormat(value)
function getPrintWithStatusDialog() / function setPrintWithStatusDialog(value)
function getHorizontalResolution() / function setHorizontalResolution(value)
function getVerticalResolution() / function setVerticalResolution(value)
function getTiffCompression() / function setTiffCompression(value)
Tiff
format.
The value of the property is TiffCompression integer constant.function getTiffColorDepth() / function setTiffColorDepth(value)
Tiff
format.
The value of the property is ColorDepth integer constant.function getPrintingPage() / function setPrintingPage(value)
function getQuality() / function setQuality(value)
Jpeg
format. The default value is 100
function getImageType() / function setImageType(value)
function isCellAutoFit() / function setCellAutoFit(value)
function getOnePagePerSheet() / function setOnePagePerSheet(value)
function getAllColumnsInOnePagePerSheet() / function setAllColumnsInOnePagePerSheet(value)
function getDrawObjectEventHandler() / function setDrawObjectEventHandler(value)
function getChartImageType() / function setChartImageType(value)
function getEmbededImageNameInSvg() / function setEmbededImageNameInSvg(value)
function getSVGFitToViewPort() / function setSVGFitToViewPort(value)
function getOnlyArea() / function setOnlyArea(value)
function getTransparent() / function setTransparent(value)
function getPageSavingCallback() / function setPageSavingCallback(value)
function isFontSubstitutionCharGranularity() / function setFontSubstitutionCharGranularity(value)
function getPageIndex() / function setPageIndex(value)
function getPageCount() / function setPageCount(value)
function isOptimized() / function setOptimized(value)
function getDefaultFont() / function setDefaultFont(value)
function getCheckWorkbookDefaultFont() / function setCheckWorkbookDefaultFont(value)
function getOutputBlankPageWhenNothingToPrint() / function setOutputBlankPageWhenNothingToPrint(value)
function getGridlineType() / function setGridlineType(value)
function getTextCrossType() / function setTextCrossType(value)
function getDefaultEditLanguage() / function setDefaultEditLanguage(value)
function getSheetSet() / function setSheetSet(value)
function getEmfRenderSetting() / function setEmfRenderSetting(value)
function getTiffPhotometricInterpretation()
Tiff
format.
function setTiffPhotometricInterpretation(value)
Tiff
format.
function setRenderingHint(key, value)
key: Key
- the key of the hint to be set.value: Object
- the value indicating preferences for the specified hint category.function setDesiredSize(desiredWidth, desiredHeight)
desiredWidth: Number
- desired width in pixelsdesiredHeight: Number
- desired height in pixelsfunction setDesiredSize(desiredWidth, desiredHeight, keepAspectRatio)
desiredWidth: Number
- desired width in pixelsdesiredHeight: Number
- desired height in pixelskeepAspectRatio: boolean
- whether to keep aspect ratio of origin image