Package cells.print

Source Code of cells.print.AsposePrintWorkbook

package cells.print;

import com.aspose.cells.ImageOrPrintOptions;
import com.aspose.cells.SheetRender;
import com.aspose.cells.Workbook;
import com.aspose.cells.WorkbookRender;
import com.aspose.cells.Worksheet;

public class AsposePrintWorkbook
{
  public static void main(String[] args) throws Exception
  {
    //Instantiate a new workbook
    Workbook book = new Workbook("data/AsposeDataInput.xls");

    //Create an object for ImageOptions
    ImageOrPrintOptions  imgOptions = new ImageOrPrintOptions ();

    //Get the first worksheet
    Worksheet sheet = book.getWorksheets().get(0);
   
    //Create a SheetRender object with respect to your desired sheet
    SheetRender sr = new SheetRender(sheet, imgOptions);

    //Print the worksheet 
    sr.toPrinter("Samsung ML-1520 Series");
       
    //Create a WorkbookRender object with respect to your workbook
    WorkbookRender wr = new WorkbookRender(book, imgOptions);

    //Print the workbook 
    wr.toPrinter("Samsung ML-1520 Series");
  }
}
TOP

Related Classes of cells.print.AsposePrintWorkbook

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.