Search in sources :

Example 11 with CTPageSetup

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup in project poi by apache.

the class TestXSSFPrintSetup method testSetGetPaperSize.

public void testSetGetPaperSize() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setPaperSize(9);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(PaperSize.A4_PAPER, printSetup.getPaperSizeEnum());
    assertEquals(9, printSetup.getPaperSize());
    printSetup.setPaperSize(PaperSize.A3_PAPER);
    assertEquals(8, pSetup.getPaperSize());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 12 with CTPageSetup

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup in project poi by apache.

the class TestXSSFPrintSetup method testSetGetScale.

public void testSetGetScale() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setScale(9);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(9, printSetup.getScale());
    printSetup.setScale((short) 100);
    assertEquals(100, pSetup.getScale());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Example 13 with CTPageSetup

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup in project poi by apache.

the class TestXSSFPrintSetup method testSetGetPageStart.

public void testSetGetPageStart() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageSetup pSetup = worksheet.addNewPageSetup();
    pSetup.setFirstPageNumber(9);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(9, printSetup.getPageStart());
    printSetup.setPageStart((short) 1);
    assertEquals(1, pSetup.getFirstPageNumber());
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageSetup(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)

Aggregations

CTPageSetup (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup)13 CTWorksheet (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet)13