Package org.openxmlformats.schemas.wordprocessingml.x2006.main

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr


      }
   }
  
   public void appendParagraphText(StringBuffer text, XWPFParagraph paragraph){
      try {
          CTSectPr ctSectPr = null;
          if (paragraph.getCTP().getPPr()!=null) {
              ctSectPr = paragraph.getCTP().getPPr().getSectPr();
          }

          XWPFHeaderFooterPolicy headerFooterPolicy = null;
View Full Code Here


      }
   }
  
   public void appendParagraphText(StringBuffer text, XWPFParagraph paragraph){
      try {
          CTSectPr ctSectPr = null;
          if (paragraph.getCTP().getPPr()!=null) {
              ctSectPr = paragraph.getCTP().getPPr().getSectPr();
          }

          XWPFHeaderFooterPolicy headerFooterPolicy = null;
View Full Code Here

       // If this paragraph is actually a whole new section, then
       //  it could have its own headers and footers
       // Check and handle if so
       XWPFHeaderFooterPolicy headerFooterPolicy = null;
       if (paragraph.getCTP().getPPr() != null) {
           CTSectPr ctSectPr = paragraph.getCTP().getPPr().getSectPr();
           if(ctSectPr != null) {
              headerFooterPolicy =
                  new XWPFHeaderFooterPolicy(document, ctSectPr);
              extractHeaders(xhtml, headerFooterPolicy);
           }
View Full Code Here

  public XWPFHeaderFooterPolicy(XWPFDocument doc) throws IOException, XmlException {
    // Grab what headers and footers have been defined
    // For now, we don't care about different ranges, as it
    //  doesn't seem that .docx properly supports that
    //  feature of the file format yet
    CTSectPr sectPr = doc.getDocument().getBody().getSectPr();
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      XWPFHeader hdr = new XWPFHeader(
          HdrDocument.Factory.parse(hdrPart.getInputStream()).getHdr()
      );

      // Assign it
      if(ref.getType() == STHdrFtr.FIRST) {
        firstPageHeader = hdr;
      } else if(ref.getType() == STHdrFtr.EVEN) {
        evenPageHeader = hdr;
      } else {
        defaultHeader = hdr;
      }
    }
    for(int i=0; i<sectPr.sizeOfFooterReferenceArray(); i++) {
      // Get the footer
      CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i);
      PackagePart ftrPart = doc.getPartById(ref.getId());
      XWPFFooter ftr = new XWPFFooter(
          FtrDocument.Factory.parse(ftrPart.getInputStream()).getFtr()
      );
View Full Code Here

    while(i.hasNext()) {
                        XWPFParagraph paragraph = i.next();


                        try {
                                CTSectPr ctSectPr = null;
                                if (paragraph.getCTP().getPPr()!=null) {
                                        ctSectPr = paragraph.getCTP().getPPr().getSectPr();
                                }

                                XWPFHeaderFooterPolicy headerFooterPolicy = null;
View Full Code Here

    Iterator<XWPFParagraph> i = document.getParagraphsIterator();
    while(i.hasNext()) {
      XWPFParagraph paragraph = i.next();

      try {
        CTSectPr ctSectPr = null;
        if (paragraph.getCTP().getPPr()!=null) {
          ctSectPr = paragraph.getCTP().getPPr().getSectPr();
        }

        XWPFHeaderFooterPolicy headerFooterPolicy = null;
View Full Code Here

      }
   }
  
   public void appendParagraphText(StringBuffer text, XWPFParagraph paragraph){
      try {
          CTSectPr ctSectPr = null;
          if (paragraph.getCTP().getPPr()!=null) {
              ctSectPr = paragraph.getCTP().getPPr().getSectPr();
          }

          XWPFHeaderFooterPolicy headerFooterPolicy = null;
View Full Code Here

    Iterator<XWPFParagraph> i = document.getParagraphsIterator();
    while(i.hasNext()) {
      XWPFParagraph paragraph = i.next();

      try {
        CTSectPr ctSectPr = null;
        if (paragraph.getCTP().getPPr()!=null) {
          ctSectPr = paragraph.getCTP().getPPr().getSectPr();
        }

        XWPFHeaderFooterPolicy headerFooterPolicy = null;
View Full Code Here

    Iterator<XWPFParagraph> i = document.getParagraphsIterator();
    while(i.hasNext()) {
      XWPFParagraph paragraph = i.next();

      try {
        CTSectPr ctSectPr = null;
        if (paragraph.getCTP().getPPr()!=null) {
          ctSectPr = paragraph.getCTP().getPPr().getSectPr();
        }

        XWPFHeaderFooterPolicy headerFooterPolicy = null;
View Full Code Here

  public XWPFHeaderFooterPolicy(XWPFDocument doc) throws IOException, XmlException {
    // Grab what headers and footers have been defined
    // For now, we don't care about different ranges, as it
    //  doesn't seem that .docx properly supports that
    //  feature of the file format yet
    CTSectPr sectPr = doc.getDocumentBody().getSectPr();
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      XWPFHeader hdr = new XWPFHeader(
          HdrDocument.Factory.parse(hdrPart.getInputStream()).getHdr()
      );

      // Assign it
      if(ref.getType() == STHdrFtr.FIRST) {
        firstPageHeader = hdr;
      } else if(ref.getType() == STHdrFtr.EVEN) {
        evenPageHeader = hdr;
      } else {
        defaultHeader = hdr;
      }
    }
    for(int i=0; i<sectPr.sizeOfFooterReferenceArray(); i++) {
      // Get the footer
      CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i);
      PackagePart ftrPart = doc.getPartById(ref.getId());
      XWPFFooter ftr = new XWPFFooter(
          FtrDocument.Factory.parse(ftrPart.getInputStream()).getFtr()
      );
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr

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.