Package org.odftoolkit.simple.style

Examples of org.odftoolkit.simple.style.MasterPage$StyleHandlerImpl


      TextDocument newDoc = TextDocument.newTextDocument();

      // create a new master page
      Paragraph paragraph = newDoc
          .addParagraph("before page break - original Landscape");
      MasterPage master1 = MasterPage.getOrCreateMasterPage(newDoc,
          "Landscape");
      master1.setPageWidth(279.4);
      master1.setPageHeight(215.9);
      master1.setNumberFormat(NumberFormat.HINDU_ARABIC_NUMBER.toString());
      master1.setPrintOrientation(PrintOrientation.LANDSCAPE);
      master1.setFootnoteMaxHeight(0);
      master1.setWritingMode(StyleTypeDefinitions.WritingMode.LRTB);
      master1.setMargins(20, 20, 20, 20);
      master1.setFootnoteSepProperties(AdjustmentStyle.LEFT, Color
          .valueOf("#000000"), 1, 1, null, Percent.valueOf("25%"),
          0.18);
      newDoc.addPageBreak(paragraph, master1);
      newDoc.addParagraph("after page break - original Landscape");
      validMasterPageApplied(newDoc, paragraph, master1);
      newDoc
          .save(ResourceUtilities
              .newTestOutputFile("AddPageBreakWithMasterPageOutput1.odt"));

      // modify the master page
      paragraph = newDoc
          .addParagraph("before page break - modified Landscape");
      MasterPage master2 = MasterPage.getOrCreateMasterPage(newDoc,
          "Landscape");
      master2.setPageWidth(100);
      master2.setPageHeight(300);
      master2.setNumberFormat(null);
      master2.setPrintOrientation(null);
      master2.setMargins(20, 20, 0, 0);
      newDoc.addPageBreak(paragraph, master2);
      newDoc.addParagraph("after page break - modified Landscape");
      validMasterPageApplied(newDoc, paragraph, master2);

      // apply existing master page
      paragraph = newDoc.addParagraph("before page break - Standard");
      MasterPage master3 = MasterPage.getOrCreateMasterPage(newDoc,
          "Standard");
      newDoc.addPageBreak(paragraph, master3);
      newDoc.addParagraph("after page break - Standard");
      newDoc.addParagraph("end page");
      newDoc
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.style.MasterPage$StyleHandlerImpl

Copyright © 2018 www.massapicom. 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.