Package org.docx4j.wml

Examples of org.docx4j.wml.SectPr


      Relationship relationship )
      throws InvalidFormatException {

    List<SectionWrapper> sections = wordprocessingMLPackage.getDocumentModel().getSections();
      
    SectPr sectPr = sections.get(sections.size() - 1).getSectPr();
    // There is always a section wrapper, but it might not contain a sectPr
    if (sectPr==null ) {
      sectPr = objectFactory.createSectPr();
      wordprocessingMLPackage.getMainDocumentPart().addObject(sectPr);
      sections.get(sections.size() - 1).setSectPr(sectPr);
    }

    HeaderReference headerReference = objectFactory.createHeaderReference();
    headerReference.setId(relationship.getId());
    headerReference.setType(HdrFtrRef.DEFAULT);
    sectPr.getEGHdrFtrReferences().add(headerReference);// add header or
    // footer references

  }
View Full Code Here

TOP

Related Classes of org.docx4j.wml.SectPr

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.