Aspose::Cells::Rendering::ImageOrPrintOptions class

ImageOrPrintOptions class

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

class ImageOrPrintOptions

Methods

MethodDescription
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.
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.
GetDefaultEditLanguage()Gets or sets default edit language.
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.
GetGridlineType()Gets or sets gridline type.
GetHorizontalResolution()Gets or sets the horizontal resolution for generated images, in dots per inch.
GetImageType()Gets or sets the format of the generated images. default value: PNG.
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.
GetPageCount()Gets or sets the number of pages to save.
GetPageIndex()Gets or sets the 0-based index of the first page to save.
GetPageSavingCallback()Control/Indicate progress of page saving process.
GetPrintingPage()Indicates which pages will not be printed.
GetPrintWithStatusDialog()If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.
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.
GetSheetSet()Gets or sets the sheets to render. Default is all visible sheets in the workbook: Aspose.Cells.Rendering.SheetSet.Visible.
GetSVGFitToViewPort()if this property is true, the generated svg will fit to view port.
GetTextCrossType()Gets or sets displaying text type when the text width is larger than cell width.
GetTiffBinarizationMethod()Gets or sets method used while converting images to 1 bpp format when ImageType is Tiff and TiffCompression is equal to Ccitt3 or Ccitt4.
GetTiffColorDepth()Gets or sets bit depth to apply only when saving pages to the Tiff format.
GetTiffCompression()Gets or sets the type of compression to apply only when saving pages to the Tiff format.
GetTransparent()Indicates if the background of generated image should be transparent.
GetVerticalResolution()Gets or sets the vertical resolution for generated images, in dots per inch.
GetWarningCallback()Gets or sets warning callback.
ImageOrPrintOptions()Default constructor.
ImageOrPrintOptions(ImageOrPrintOptions_Impl* impl)Constructs from an implementation object.
ImageOrPrintOptions(const ImageOrPrintOptions& src)Copy constructor.
IsFontSubstitutionCharGranularity()Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
IsNull() constChecks whether the implementation object is nullptr.
IsOptimized()Indicates whether to optimize the output elements.
explicit operator bool() constoperator bool()
operator=(const ImageOrPrintOptions& src)operator=
SetAllColumnsInOnePagePerSheet(bool 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.
SetCheckWorkbookDefaultFont(bool 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.
SetDefaultEditLanguage(DefaultEditLanguage value)Gets or sets default edit language.
SetDefaultFont(const U16String& 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.
SetDefaultFont(const char16_t* 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.
SetDesiredSize(int32_t desiredWidth, int32_t desiredHeight, bool keepAspectRatio)Sets desired width and height of image.
SetDrawObjectEventHandler(DrawObjectEventHandler* value)Implements this interface to get DrawObject and Bound when rendering.
SetEmbededImageNameInSvg(const U16String& value)Indicate the filename of embedded image in svg. This should be full path with directory like “c:\xpsEmbedded”.
SetEmbededImageNameInSvg(const char16_t* value)Indicate the filename of embedded image in svg. This should be full path with directory like “c:\xpsEmbedded”.
SetEmfRenderSetting(EmfRenderSetting value)Setting for rendering Emf metafile.
SetGridlineType(GridlineType value)Gets or sets gridline type.
SetHorizontalResolution(int32_t value)Gets or sets the horizontal resolution for generated images, in dots per inch.
SetImageType(Aspose::Cells::Drawing::ImageType value)Gets or sets the format of the generated images. default value: PNG.
SetIsFontSubstitutionCharGranularity(bool value)Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
SetIsOptimized(bool value)Indicates whether to optimize the output elements.
SetOnePagePerSheet(bool 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.
SetOnlyArea(bool value)If this property is true , one Area will be output, and no scale will take effect.
SetOutputBlankPageWhenNothingToPrint(bool value)Indicates whether to output a blank page when there is nothing to print.
SetPageCount(int32_t value)Gets or sets the number of pages to save.
SetPageIndex(int32_t value)Gets or sets the 0-based index of the first page to save.
SetPageSavingCallback(IPageSavingCallback* value)Control/Indicate progress of page saving process.
SetPrintingPage(PrintingPageType value)Indicates which pages will not be printed.
SetPrintWithStatusDialog(bool value)If PrintWithStatusDialog = true , there will be a dialog that shows current print status. else no such dialog will show.
SetQuality(int32_t 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.
SetSheetSet(const SheetSet& value)Gets or sets the sheets to render. Default is all visible sheets in the workbook: Aspose.Cells.Rendering.SheetSet.Visible.
SetSVGFitToViewPort(bool value)if this property is true, the generated svg will fit to view port.
SetTextCrossType(TextCrossType value)Gets or sets displaying text type when the text width is larger than cell width.
SetTiffBinarizationMethod(ImageBinarizationMethod value)Gets or sets method used while converting images to 1 bpp format when ImageType is Tiff and TiffCompression is equal to Ccitt3 or Ccitt4.
SetTiffColorDepth(ColorDepth value)Gets or sets bit depth to apply only when saving pages to the Tiff format.
SetTiffCompression(TiffCompression value)Gets or sets the type of compression to apply only when saving pages to the Tiff format.
SetTransparent(bool value)Indicates if the background of generated image should be transparent.
SetVerticalResolution(int32_t value)Gets or sets the vertical resolution for generated images, in dots per inch.
SetWarningCallback(IWarningCallback* value)Gets or sets warning callback.
~ImageOrPrintOptions()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//Set Image Or Print Options
ImageOrPrintOptions options;

//Set output image format
options.SetImageType(ImageType::Png);

//Set Horizontal resolution
options.SetHorizontalResolution(300);

//Set Vertical Resolution
options.SetVerticalResolution(300);

//Instantiate Workbook
Workbook book(u"test.xls");

//Save chart as Image using ImageOrPrint Options
book.GetWorksheets().Get(0).GetCharts().Get(0).ToImage(u"chart.png", options);
Aspose::Cells::Cleanup();

See Also