Search in sources :

Example 1 with CTPageMargins

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

the class TestXSSFPrintSetup method testSetGetHeaderFooterMargin.

public void testSetGetHeaderFooterMargin() {
    CTWorksheet worksheet = CTWorksheet.Factory.newInstance();
    CTPageMargins pMargins = worksheet.addNewPageMargins();
    pMargins.setHeader(1.5);
    pMargins.setFooter(2);
    XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);
    assertEquals(1.5, printSetup.getHeaderMargin(), 0.0);
    assertEquals(2.0, printSetup.getFooterMargin(), 0.0);
    printSetup.setHeaderMargin(5);
    printSetup.setFooterMargin(3.5);
    assertEquals(5.0, pMargins.getHeader(), 0.0);
    assertEquals(3.5, pMargins.getFooter(), 0.0);
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTPageMargins(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageMargins)

Aggregations

CTPageMargins (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageMargins)1 CTWorksheet (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet)1