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

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


        //  doesn't seem that .docx properly supports that
        //  feature of the file format yet
        this.doc = doc;
        for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
            // Get the header
            CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
            POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
            XWPFHeader hdr = null;
            if (relatedPart != null && relatedPart instanceof XWPFHeader) {
                hdr = (XWPFHeader) relatedPart;
            }
            // Assign it
            Enum type = ref.getType();
            assignHeader(hdr, type);
        }
        for(int i=0; i<sectPr.sizeOfFooterReferenceArray(); i++) {
            // Get the footer
            CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i);
            POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
            XWPFFooter ftr = null;
            if (relatedPart != null && relatedPart instanceof XWPFFooter)
            {
                ftr = (XWPFFooter) relatedPart;
            }
            // Assign it
            Enum type = ref.getType();
            assignFooter(ftr, type);
        }
    }
View Full Code Here


        return ftr;
    }


    private void setFooterReference(Enum type, XWPFHeaderFooter wrapper) {
        CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewFooterReference();
        ref.setType(type);
        ref.setId(wrapper.getPackageRelationship().getId());
    }
View Full Code Here

        ref.setId(wrapper.getPackageRelationship().getId());
    }


    private void setHeaderReference(Enum type, XWPFHeaderFooter wrapper) {
        CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewHeaderReference();
        ref.setType(type);
        ref.setId(wrapper.getPackageRelationship().getId());
    }
View Full Code Here

    //  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()
      );

      // Assign it
      if(ref.getType() == STHdrFtr.FIRST) {
        firstPageFooter = ftr;
      } else if(ref.getType() == STHdrFtr.EVEN) {
        evenPageFooter = ftr;
      } else {
        defaultFooter = ftr;
      }
    }
View Full Code Here

    //  doesn't seem that .docx properly supports that
    //  feature of the file format yet
    this.doc = doc;
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      HdrDocument hdrDoc = HdrDocument.Factory.parse(hdrPart.getInputStream());
      CTHdrFtr hdrFtr = hdrDoc.getHdr();
      XWPFHeader hdr = new XWPFHeader(hdrFtr);

      // Assign it
      Enum type = ref.getType();
      assignHeader(hdr, type);
    }
    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()
      );

      // Assign it
      Enum type = ref.getType();
      assignFooter(ftr, type);
    }
  }
View Full Code Here

    return ftr;
  }


  private void setFooterReference(Enum type, XWPFHeaderFooter wrapper) {
    CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewFooterReference();
      ref.setType(type);
      ref.setId(wrapper.getPackageRelationship().getId());
  }
View Full Code Here

      ref.setId(wrapper.getPackageRelationship().getId());
  }


  private void setHeaderReference(Enum type, XWPFHeaderFooter wrapper) {
    CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewHeaderReference();
      ref.setType(type);
      ref.setId(wrapper.getPackageRelationship().getId());
  }
View Full Code Here

    //  doesn't seem that .docx properly supports that
    //  feature of the file format yet
    this.doc = doc;
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      HdrDocument hdrDoc = HdrDocument.Factory.parse(hdrPart.getInputStream());
      CTHdrFtr hdrFtr = hdrDoc.getHdr();
      XWPFHeader hdr = new XWPFHeader(hdrFtr);

      // Assign it
      Enum type = ref.getType();
      assignHeader(hdr, type);
    }
    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());

      // Assign it
      Enum type = ref.getType();
      assignFooter(ftr, type);
    }
  }
View Full Code Here

    return ftr;
  }


  private void setFooterReference(Enum type, XWPFHeaderFooter wrapper) {
    CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewFooterReference();
      ref.setType(type);
      ref.setId(wrapper.getPackageRelationship().getId());
  }
View Full Code Here

      ref.setId(wrapper.getPackageRelationship().getId());
  }


  private void setHeaderReference(Enum type, XWPFHeaderFooter wrapper) {
    CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewHeaderReference();
      ref.setType(type);
      ref.setId(wrapper.getPackageRelationship().getId());
  }
View Full Code Here

TOP

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

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.