Examples of PageSetup


Examples of com.aspose.cells.PageSetup

    //Accessing the first worksheet in the Workbook file
    WorksheetCollection worksheets = workbook.getWorksheets();
    Worksheet sheet = worksheets.get(0);
   
    //Obtaining the reference of the PageSetup of the worksheet
    PageSetup pageSetup = sheet.getPageSetup();    
   
    //Defining column numbers A & B as title columns
    pageSetup.setPrintTitleColumns("$A:$B");
   
    //Defining row numbers 1 & 2 as title rows
    pageSetup.setPrintTitleRows("$1:$2");
   
    // Workbooks can be saved in many formats
    workbook.save("data/AsposePrintTitles.xlsx", FileFormatType.XLSX);

    System.out.println("Print Titles Set successfully."); // Print Message
View Full Code Here

Examples of com.aspose.cells.PageSetup

    //Accessing the first worksheet in the Workbook file
    WorksheetCollection worksheets = workbook.getWorksheets();
    Worksheet sheet = worksheets.get(0);
   
    //Obtaining the reference of the PageSetup of the worksheet
    PageSetup pageSetup = sheet.getPageSetup();    
   
    //Defining column numbers A & B as title columns
    pageSetup.setPrintTitleColumns("$A:$B");
   
    //Defining row numbers 1 & 2 as title rows
    pageSetup.setPrintTitleRows("$1:$2");
   
    // Workbooks can be saved in many formats
    workbook.save("data/AsposePrintTitles.xlsx", FileFormatType.XLSX);

    System.out.println("Print Titles Set successfully."); // Print Message
View Full Code Here

Examples of com.aspose.cells.PageSetup

    // Accessing the first worksheet in the Workbook file
    WorksheetCollection worksheets = workbook.getWorksheets();
    Worksheet sheet = worksheets.get(0);

    // Obtaining the reference of the PageSetup of the worksheet
    PageSetup pageSetup = sheet.getPageSetup();

    // Specifying the cells range (from A1 cell to F20 cell) of the print area
    pageSetup.setPrintArea("A1:F20");

    // Workbooks can be saved in many formats
    workbook.save("data/AsposePrintArea.xlsx", FileFormatType.XLSX);

    System.out.println("Print Area Set successfully."); // Print Message
View Full Code Here

Examples of com.aspose.cells.PageSetup

  {
    //Instantiating a Workbook object
    Workbook workbook = new Workbook();

    //Obtaining the reference of the PageSetup of the worksheet
    PageSetup pageSetup = workbook.getWorksheets().get(0).getPageSetup();

    //Setting worksheet name at the left  header
    pageSetup.setHeader(0, "&A");

    //Setting current date and current time at the central header
    //and changing the font of the header
    pageSetup.setHeader(1, "&\"Times New Roman,Bold\"&D-&T");

    //Setting current file name at the right header and changing the font of the header
    pageSetup.setHeader(2, "&\"Times New Roman,Bold\"&12&F");

    //Setting a string at the left footer and changing the font of the footer
    pageSetup.setFooter(0, "Hello World! &\"Courier New\"&14 123");

    //Setting picture at the central footer
    pageSetup.setFooter(1, "&G");

    FileInputStream fis = new FileInputStream("data/footer.png");
    byte[] picData = new byte[fis.available()];
    fis.read(picData);
    pageSetup.setFooterPicture(1, picData);
    fis.close();

    //Setting the current page number and page count at the right footer
    pageSetup.setFooter(2, "&Pof&N");
   
    //Saving the workbook
    workbook.save("data/AsposeHeaderFooter.xls");

    System.out.println("Aspose Header Footer Created.");
View Full Code Here

Examples of com.aspose.words.PageSetup

  public static void main(String[] args) throws Exception
  {
    Document doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);

    PageSetup pageSetup = builder.getPageSetup();
    pageSetup.setTopMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setBottomMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setLeftMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setRightMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setHeaderDistance(ConvertUtil.inchToPoint(0.2));
    pageSetup.setFooterDistance(ConvertUtil.inchToPoint(0.2));
   
    doc.save("data/AsposePageBorders.docx");
  }
View Full Code Here

Examples of com.aspose.words.PageSetup

  {
    Document doc = new Document();
      DocumentBuilder builder = new DocumentBuilder(doc);

      Section currentSection = builder.getCurrentSection();
      PageSetup pageSetup = currentSection.getPageSetup();

      // Specify if we want headers/footers of the first page to be different from other pages.
      // You can also use PageSetup.OddAndEvenPagesHeaderFooter property to specify
      // different headers/footers for odd and even pages.
      pageSetup.setDifferentFirstPageHeaderFooter(true);

      // --- Create header for the first page. ---
      pageSetup.setHeaderDistance(20);
      builder.moveToHeaderFooter(HeaderFooterType.FOOTER_FIRST);
      builder.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);

      // Set font properties for header text.
      builder.getFont().setName("Arial");
View Full Code Here

Examples of com.aspose.words.PageSetup

  {
    Document doc = new Document();
      DocumentBuilder builder = new DocumentBuilder(doc);

      Section currentSection = builder.getCurrentSection();
      PageSetup pageSetup = currentSection.getPageSetup();

      // Specify if we want headers/footers of the first page to be different from other pages.
      // You can also use PageSetup.OddAndEvenPagesHeaderFooter property to specify
      // different headers/footers for odd and even pages.
      pageSetup.setDifferentFirstPageHeaderFooter(true);

      // --- Create header for the first page. ---
      pageSetup.setHeaderDistance(20);
      builder.moveToHeaderFooter(HeaderFooterType.HEADER_FIRST);
      builder.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);

      // Set font properties for header text.
      builder.getFont().setName("Arial");
View Full Code Here
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.