public class ImageOrPrintOptions
extends java.lang.Object
Example
//Set Image Or Print Options
ImageOrPrintOptions options = new ImageOrPrintOptions();
//Set output image format
options.setImageType(ImageType.PNG);
//Set Horizontal resolution
options.setHorizontalResolution(300);
//Set Vertical Resolution
options.setVerticalResolution(300);
//Instantiate Workbook
Workbook book = new Workbook("test.xls");
//Save chart as Image using ImageOrPrint Options
book.getWorksheets().get(0).getCharts().get(0).toImage("chart.png", options);
| Constructor and Description |
|---|
ImageOrPrintOptions() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAllColumnsInOnePagePerSheet()
If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result.
|
ImageFormat |
getChartImageType()
Deprecated.
Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality.
|
boolean |
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.
|
int |
getDefaultEditLanguage()
Gets default edit language.
|
java.lang.String |
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.
|
DrawObjectEventHandler |
getDrawObjectEventHandler()
Implements this interface to get DrawObject and Bound when rendering.
|
java.lang.String |
getEmbededImageNameInSvg()
Indicate the filename of embedded image in svg.
|
int |
getEmfRenderSetting()
Setting for rendering Emf metafile.
|
int |
getGridlineType()
Gets gridline type.
|
int |
getHorizontalResolution()
Gets the horizontal resolution for generated images, in dots per inch.
|
int |
getImageType()
Gets the format of the generated images.
|
boolean |
getOnePagePerSheet()
If OnePagePerSheet is true , all content of one sheet will output to only one page in result.
|
boolean |
getOnlyArea()
If this property is true , one Area will be output, and no scale will take effect.
|
boolean |
getOutputBlankPageWhenNothingToPrint()
Indicates whether to output a blank page when there is nothing to print.
|
int |
getPageCount()
Gets the number of pages to save.
|
int |
getPageIndex()
Gets the 0-based index of the first page to save.
|
IPageSavingCallback |
getPageSavingCallback()
Control/Indicate progress of page saving process.
|
int |
getPrintingPage()
Indicates which pages will not be printed.
|
boolean |
getPrintWithStatusDialog()
If PrintWithStatusDialog = true , there will be a dialog that shows current print status.
|
int |
getQuality()
Gets a value determining the quality of the generated images
to apply only when saving pages to the
Jpeg format. |
int |
getSaveFormat()
Deprecated.
For Tiff/Svg, use ImageType; For Xps, use Workbook.Save(string, SaveOptions) with XpsSaveOptions
|
SheetSet |
getSheetSet()
Gets the sheets to render.
|
boolean |
getSVGFitToViewPort()
if this property is true, the generated svg will fit to view port.
|
int |
getTextCrossType()
Gets displaying text type when the text width is larger than cell width.
|
int |
getTiffColorDepth()
Gets bit depth to apply only when saving pages to the
Tiff format. |
int |
getTiffCompression()
Gets the type of compression to apply only when saving pages to the
Tiff format. |
int |
getTiffPhotometricInterpretation()
Gets the type of PhotometricInterpretation to apply only when saving pages to the
Tiff format. |
boolean |
getTransparent()
Indicates if the background of generated image should be transparent.
|
int |
getVerticalResolution()
Gets the vertical resolution for generated images, in dots per inch.
|
IWarningCallback |
getWarningCallback()
Gets warning callback.
|
boolean |
isCellAutoFit()
Deprecated.
Use Worksheet.AutoFitColumns(AutoFitterOptions) and Worksheet.AutoFitRows(AutoFitterOptions) instead.
|
boolean |
isFontSubstitutionCharGranularity()
Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
|
boolean |
isOptimized()
Indicates whether to optimize the output elements.
|
void |
setAllColumnsInOnePagePerSheet(boolean value)
If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result.
|
void |
setCellAutoFit(boolean value)
Deprecated.
Use Worksheet.AutoFitColumns(AutoFitterOptions) and Worksheet.AutoFitRows(AutoFitterOptions) instead.
|
void |
setChartImageType(ImageFormat value)
Deprecated.
Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality.
|
void |
setCheckWorkbookDefaultFont(boolean 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.
|
void |
setDefaultEditLanguage(int value)
Sets default edit language.
|
void |
setDefaultFont(java.lang.String 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.
|
void |
setDesiredSize(int desiredWidth,
int desiredHeight)
Deprecated.
Use SetDesiredSize(int, int, bool) by setting param keepAspectRatio to false instead.
|
void |
setDesiredSize(int desiredWidth,
int desiredHeight,
boolean keepAspectRatio)
Sets desired width and height of image.
|
void |
setDrawObjectEventHandler(DrawObjectEventHandler value)
Implements this interface to get DrawObject and Bound when rendering.
|
void |
setEmbededImageNameInSvg(java.lang.String value)
Indicate the filename of embedded image in svg.
|
void |
setEmfRenderSetting(int value)
Setting for rendering Emf metafile.
|
void |
setFontSubstitutionCharGranularity(boolean value)
Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
|
void |
setGridlineType(int value)
Sets gridline type.
|
void |
setHorizontalResolution(int value)
Sets the horizontal resolution for generated images, in dots per inch.
|
void |
setImageType(int value)
Sets the format of the generated images.
|
void |
setOnePagePerSheet(boolean value)
If OnePagePerSheet is true , all content of one sheet will output to only one page in result.
|
void |
setOnlyArea(boolean value)
If this property is true , one Area will be output, and no scale will take effect.
|
void |
setOptimized(boolean value)
Indicates whether to optimize the output elements.
|
void |
setOutputBlankPageWhenNothingToPrint(boolean value)
Indicates whether to output a blank page when there is nothing to print.
|
void |
setPageCount(int value)
Sets the number of pages to save.
|
void |
setPageIndex(int value)
Sets the 0-based index of the first page to save.
|
void |
setPageSavingCallback(IPageSavingCallback value)
Control/Indicate progress of page saving process.
|
void |
setPrintingPage(int value)
Indicates which pages will not be printed.
|
void |
setPrintWithStatusDialog(boolean value)
If PrintWithStatusDialog = true , there will be a dialog that shows current print status.
|
void |
setQuality(int value)
Sets a value determining the quality of the generated images
to apply only when saving pages to the
Jpeg format. |
void |
setRenderingHint(java.awt.RenderingHints.Key key,
java.lang.Object value)
Sets the value of a single preference for the rendering algorithms.
|
void |
setSaveFormat(int value)
Deprecated.
For Tiff/Svg, use ImageType; For Xps, use Workbook.Save(string, SaveOptions) with XpsSaveOptions
|
void |
setSheetSet(SheetSet value)
Sets the sheets to render.
|
void |
setSVGFitToViewPort(boolean value)
if this property is true, the generated svg will fit to view port.
|
void |
setTextCrossType(int value)
Sets displaying text type when the text width is larger than cell width.
|
void |
setTiffColorDepth(int value)
Sets bit depth to apply only when saving pages to the
Tiff format. |
void |
setTiffCompression(int value)
Sets the type of compression to apply only when saving pages to the
Tiff format. |
void |
setTiffPhotometricInterpretation(int value)
Sets the type of PhotometricInterpretation to apply only when saving pages to the
Tiff format. |
void |
setTransparent(boolean value)
Indicates if the background of generated image should be transparent.
|
void |
setVerticalResolution(int value)
Sets the vertical resolution for generated images, in dots per inch.
|
void |
setWarningCallback(IWarningCallback value)
Sets warning callback.
|
public int getSaveFormat()
See SaveFormat.
Remarks
NOTE: This member is now obsolete. Instead, For Tiff/Svg, usegetImageType(); For Xps, use Workbook.save(String,SaveOptions) with XpsSaveOptions.
This property will be removed 12 months later since August 2022.
Aspose apologizes for any inconvenience you may have experienced.public void setSaveFormat(int value)
See SaveFormat.
Remarks
NOTE: This member is now obsolete. Instead, For Tiff/Svg, usegetImageType(); For Xps, use Workbook.save(String,SaveOptions) with XpsSaveOptions.
This property will be removed 12 months later since August 2022.
Aspose apologizes for any inconvenience you may have experienced.public boolean getPrintWithStatusDialog()
public void setPrintWithStatusDialog(boolean value)
public int getHorizontalResolution()
Remarks
The default value is 96.public void setHorizontalResolution(int value)
Remarks
The default value is 96.public int getVerticalResolution()
Remarks
The default value is 96.public void setVerticalResolution(int value)
Remarks
The default value is 96.public int getTiffCompression()
Tiff format.
See TiffCompression.
Remarks
Has effect only when saving to TIFF. The default value is Lzw.public void setTiffCompression(int value)
Tiff format.
See TiffCompression.
Remarks
Has effect only when saving to TIFF. The default value is Lzw.public int getTiffColorDepth()
Tiff format.
See 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.public void setTiffColorDepth(int value)
Tiff format.
See 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.public int getTiffPhotometricInterpretation()
Tiff format.
Remarks
Has effect only when saving to TIFF. The default value is -1, represent no PhotometricInterpretation is applied.public void setTiffPhotometricInterpretation(int value)
Tiff format.
Remarks
Has effect only when saving to TIFF. The default value is -1, represent no PhotometricInterpretation is applied.public int getPrintingPage()
See PrintingPageType.
public void setPrintingPage(int value)
See PrintingPageType.
public int getQuality()
Jpeg format. The default value is 100
Remarks
Has effect only when saving to JPEG. The value must be between 0 and 100. The default value is 100.public void setQuality(int value)
Jpeg format. The default value is 100
Remarks
Has effect only when saving to JPEG. The value must be between 0 and 100. The default value is 100.public int getImageType()
See getImageType().
public void setImageType(int value)
See getImageType().
public boolean isCellAutoFit()
Remarks
NOTE: This member is now obsolete. Instead, please useWorksheet.autoFitColumns(AutoFitterOptions) and Worksheet.autoFitRows(AutoFitterOptions).
This property will be removed 12 months later since August 2022.
Aspose apologizes for any inconvenience you may have experienced.public void setCellAutoFit(boolean value)
Remarks
NOTE: This member is now obsolete. Instead, please useWorksheet.autoFitColumns(AutoFitterOptions) and Worksheet.autoFitRows(AutoFitterOptions).
This property will be removed 12 months later since August 2022.
Aspose apologizes for any inconvenience you may have experienced.public boolean getOnePagePerSheet()
public void setOnePagePerSheet(boolean value)
public boolean getAllColumnsInOnePagePerSheet()
public void setAllColumnsInOnePagePerSheet(boolean value)
public DrawObjectEventHandler getDrawObjectEventHandler()
public void setDrawObjectEventHandler(DrawObjectEventHandler value)
public ImageFormat getChartImageType()
Remarks
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.public void setChartImageType(ImageFormat value)
Remarks
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.public java.lang.String getEmbededImageNameInSvg()
public void setEmbededImageNameInSvg(java.lang.String value)
public boolean getSVGFitToViewPort()
public void setSVGFitToViewPort(boolean value)
public boolean getOnlyArea()
public void setOnlyArea(boolean value)
public void setRenderingHint(java.awt.RenderingHints.Key key,
java.lang.Object value)
key - the key of the hint to be set.value - the value indicating preferences for the specified hint category.public boolean getTransparent()
Remarks
The default value is false. That means the background of the generated images is white.public void setTransparent(boolean value)
Remarks
The default value is false. That means the background of the generated images is white.public IWarningCallback getWarningCallback()
public void setWarningCallback(IWarningCallback value)
public IPageSavingCallback getPageSavingCallback()
public void setPageSavingCallback(IPageSavingCallback value)
public boolean isFontSubstitutionCharGranularity()
Remarks
Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.public void setFontSubstitutionCharGranularity(boolean value)
Remarks
Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.public int getPageIndex()
Remarks
Default is 0.public void setPageIndex(int value)
Remarks
Default is 0.public int getPageCount()
Remarks
Default is System.Int32.MaxValue which means all pages will be rendered.public void setPageCount(int value)
Remarks
Default is System.Int32.MaxValue which means all pages will be rendered.public void setDesiredSize(int desiredWidth,
int desiredHeight)
Remarks
NOTE: This member is now obsolete. Instead, please usesetDesiredSize(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.desiredWidth - desired width in pixelsdesiredHeight - desired height in pixelspublic void setDesiredSize(int desiredWidth,
int desiredHeight,
boolean keepAspectRatio)
desiredWidth - desired width in pixelsdesiredHeight - desired height in pixelskeepAspectRatio - whether to keep aspect ratio of origin imagepublic boolean isOptimized()
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.public void setOptimized(boolean value)
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.public java.lang.String getDefaultFont()
public void setDefaultFont(java.lang.String value)
public boolean getCheckWorkbookDefaultFont()
Remarks
Default is true.public void setCheckWorkbookDefaultFont(boolean value)
Remarks
Default is true.public boolean getOutputBlankPageWhenNothingToPrint()
Remarks
Default is false.public void setOutputBlankPageWhenNothingToPrint(boolean value)
Remarks
Default is false.public int getGridlineType()
See GridlineType.
Remarks
Default is Dotted type.public void setGridlineType(int value)
See GridlineType.
Remarks
Default is Dotted type.public int getTextCrossType()
See TextCrossType.
public void setTextCrossType(int value)
See TextCrossType.
public int getDefaultEditLanguage()
See DefaultEditLanguage.
Remarks
It may display/render different layouts for text paragraph when different edit languages is set. Default isDefaultEditLanguage.AUTO.public void setDefaultEditLanguage(int value)
See DefaultEditLanguage.
Remarks
It may display/render different layouts for text paragraph when different edit languages is set. Default isDefaultEditLanguage.AUTO.public SheetSet getSheetSet()
SheetSet.getVisible().
Remarks
The set is ignored when it is used inSheetRenderpublic void setSheetSet(SheetSet value)
SheetSet.getVisible().
Remarks
The set is ignored when it is used inSheetRenderpublic int getEmfRenderSetting()
See 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. WhenEmfRenderSetting.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.public void setEmfRenderSetting(int value)
See 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. WhenEmfRenderSetting.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.See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2001-2023. All Rights Reserved.