aspose.cells

Class WorkbookRender

Represents a Workbook render. The constructor of this class , must be used after modification of pagesetup, cell style.

Constructor Summary
WorkbookRender(workbook, options)
The construct of WorkbookRender
 
Property Getters/Setters Summary
functiongetPageCount()
Indicate the total page count of current worksheet
 
Method Summary
functiontoImage(pageIndex, stream)
Render certain page to a stream.
functiontoImage(pageIndex, fileName)
Render certain page to a file.
functiontoImage(filename)
Render whole workbook as Tiff Image to a file.
static functiontoImageStream(workbookRender, stream)
Converts a sparkline to an image.
functiontoPrinter(PrinterName)
Render workbook to Printer
functiontoPrinter(PrinterName, DocumentName)
Render workbook to Printer
 

    • Constructor Detail

      • WorkbookRender

        function WorkbookRender(workbook, options)
        The construct of WorkbookRender
        Parameters:
        workbook: Workbook - Indicate which workbook to be rendered.
        options: ImageOrPrintOptions - ImageOrPrintOptions contains some property of output kiimage
    • Property Getters/Setters Detail

      • getPageCount : Number 

        function getPageCount()
        
        Indicate the total page count of current worksheet
    • Method Detail

      • toImage

        function toImage(filename)
        Render whole workbook as Tiff Image to a file.
        Parameters:
        filename: String - the filename of the output image
      • toImage

        function toImage(pageIndex, fileName)
        Render certain page to a file.
        Parameters:
        pageIndex: Number - indicate which page is to be converted
        fileName: String - filename of the output image
      • toImage

        function toImage(pageIndex, stream)
        Render certain page to a stream.
        Parameters:
        pageIndex: Number - indicate which page is to be converted
        stream: OutputStream - the stream of the output image
      • toPrinter

        function toPrinter(PrinterName)
        Render workbook to Printer
        Parameters:
        PrinterName: String - the name of the printer , for example: "Microsoft Office Document Image Writer"
      • toPrinter

        function toPrinter(PrinterName, DocumentName)
        Render workbook to Printer
        Parameters:
        PrinterName: String - the name of the printer , for example: "Microsoft Office Document Image Writer"
        DocumentName: String - set the print job name
      • toImageStream

        static function toImageStream(workbookRender, stream)
        Converts a sparkline to an image.
        Parameters:
        workbookRender: WorkbookRender - The WorkbookRender object
        stream: WritableStream - The stream of the output image

        Example:

        var aspose = aspose || {};
        aspose.cells = require("aspose.cells");
        var fs = require("fs");
        
        var workbook = new aspose.cells.Workbook("Book2.xlsx");
        var imgOptions = new aspose.cells.ImageOrPrintOptions();
        imgOptions.setHorizontalResolution(200);
        imgOptions.setVerticalResolution(300);
        imgOptions.setSaveFormat(aspose.cells.SaveFormat.XPS);
        var workbookRender = new aspose.cells.WorkbookRender(workbook, imgOptions);
        var imgWriteStream = fs.createWriteStream("workbook.xps");
        aspose.cells.WorkbookRender.toImageStream(workbookRender, imgWriteStream);