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

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


        setHeaderReference(type, wrapper);
        return hdr;
    }

    private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs) {
        CTHdrFtr ftr = CTHdrFtr.Factory.newInstance();
        if (paragraphs != null) {
            for (int i = 0 ; i < paragraphs.length ; i++) {
                CTP p = ftr.addNewP();
                //ftr.setPArray(0, paragraphs[i].getCTP());    // MB 23 May 2010
                ftr.setPArray(i, paragraphs[i].getCTP());     // MB 23 May 2010
            }
        }
        else {
            CTP p = ftr.addNewP();
            byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
            byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
            p.setRsidP(rsidr);
            p.setRsidRDefault(rsidrdefault);
            CTPPr pPr = p.addNewPPr();
View Full Code Here


     * it should have recovered the CTHdrFtr object encapsulated within the XWPFHeaderFooter object
     * that had previoulsy been instantiated in the createHeader(int, XWPFParagraph[]) or
     * createFooter(int, XWPFParagraph[]) methods.
     */
    private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs, XWPFHeaderFooter wrapper) {
        CTHdrFtr ftr = wrapper._getHdrFtr();
        if (paragraphs != null) {
            for (int i = 0 ; i < paragraphs.length ; i++) {
                CTP p = ftr.addNewP();
                ftr.setPArray(i, paragraphs[i].getCTP());
            }
        }
        else {
            CTP p = ftr.addNewP();
            byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
            byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
            p.setRsidP(rsidr);
            p.setRsidRDefault(rsidrdefault);
            CTPPr pPr = p.addNewPPr();
View Full Code Here

    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);
View Full Code Here

      String pStyle = "Header";
      int i = getRelationIndex(relation);
      HdrDocument hdrDoc = HdrDocument.Factory.newInstance();
      XWPFHeader wrapper = (XWPFHeader)doc.createRelationship(relation, XWPFFactory.getInstance(), i);

      CTHdrFtr hdr = buildHdr(type, pStyle, wrapper, pars);
     
      OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
      hdrDoc.setHdr(hdr);
     
        XmlOptions xmlOptions = commit(wrapper);
View Full Code Here

      String pStyle = "Footer";
      int i = getRelationIndex(relation);
      FtrDocument ftrDoc = FtrDocument.Factory.newInstance();
      XWPFFooter wrapper = (XWPFFooter)doc.createRelationship(relation, XWPFFactory.getInstance(), i);

      CTHdrFtr ftr = buildFtr(type, pStyle, wrapper, pars);
     
      OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
      ftrDoc.setFtr(ftr);
     
        XmlOptions xmlOptions = commit(wrapper);
View Full Code Here

    return i;
  }


  private CTHdrFtr buildFtr(Enum type, String pStyle, XWPFHeaderFooter wrapper, XWPFParagraph[] pars) {
    CTHdrFtr ftr = buildHdrFtr(pStyle, pars);
      setFooterReference(type, wrapper);
    return ftr;
  }
View Full Code Here

    return ftr;
  }


  private CTHdrFtr buildHdr(Enum type, String pStyle, XWPFHeaderFooter wrapper, XWPFParagraph[] pars) {
    CTHdrFtr hdr = buildHdrFtr(pStyle, pars);
      setHeaderReference(type, wrapper);
    return hdr;
  }
View Full Code Here

      setHeaderReference(type, wrapper);
    return hdr;
  }

  private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs) {
    CTHdrFtr ftr = CTHdrFtr.Factory.newInstance();
    if (paragraphs != null) {
      for (int i = 0 ; i < paragraphs.length ; i++) {
        CTP p = ftr.addNewP();
        ftr.setPArray(0, paragraphs[i].getCTP());
      }
    }
    else {
      CTP p = ftr.addNewP();
      byte[] rsidr = doc.getDocument().getBody().getPArray()[0].getRsidR();
      byte[] rsidrdefault = doc.getDocument().getBody().getPArray()[0].getRsidRDefault();
      p.setRsidP(rsidr);
      p.setRsidRDefault(rsidrdefault);
      CTPPr pPr = p.addNewPPr();
View Full Code Here

    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);
View Full Code Here

      String pStyle = "Header";
      int i = getRelationIndex(relation);
      HdrDocument hdrDoc = HdrDocument.Factory.newInstance();
      XWPFHeader wrapper = (XWPFHeader)doc.createRelationship(relation, XWPFFactory.getInstance(), i);

      CTHdrFtr hdr = buildHdr(type, pStyle, wrapper, pars);
      wrapper.setHeaderFooter(hdr);
     
      OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
      hdrDoc.setHdr(hdr);
     
View Full Code Here

TOP

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

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.