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
    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


          XmlObject o = c.getObject();
          if(o instanceof CTR) {
             runs.add(new XWPFRun((CTR)o, this));
          }
          if(o instanceof CTHyperlink) {
             CTHyperlink link = (CTHyperlink)o;
             for(CTR r : link.getRList()) {
                runs.add(new XWPFHyperlinkRun(link, r, this));
             }
          }
          if(o instanceof CTSdtRun) {
             CTSdtContentRun run = ((CTSdtRun)o).getSdtContent();
View Full Code Here

        CTP ctp = p.getCTP();
        CTPPr ppr = ctp.getPPr()== null? ctp.addNewPPr() : ctp.getPPr();

        assertEquals(-1, p.getIndentationLeft());

        CTInd ind = ppr.addNewInd();
        ind.setLeft(new BigInteger("10"));
        assertEquals(10, p.getIndentationLeft());

        p.setIndentationLeft(100);
        assertEquals(100, ind.getLeft().intValue());
    }
View Full Code Here

     * </p>
     *
     * @param indentation
     */
    public void setIndentationLeft(int indentation) {
        CTInd indent = getCTInd(true);
        BigInteger bi = new BigInteger("" + indentation);
        indent.setLeft(bi);
    }
View Full Code Here

     * </p>
     *
     * @return indentation or null if indentation is not set
     */
    public int getIndentationLeft() {
        CTInd indentation = getCTInd(false);
        return (indentation != null && indentation.isSetLeft()) ? indentation.getLeft().intValue()
                : -1;
    }
View Full Code Here

     * </p>
     *
     * @param indentation
     */
    public void setIndentationRight(int indentation) {
        CTInd indent = getCTInd(true);
        BigInteger bi = new BigInteger("" + indentation);
        indent.setRight(bi);
    }
View Full Code Here

     *
     * @return indentation or null if indentation is not set
     */

    public int getIndentationRight() {
        CTInd indentation = getCTInd(false);
        return (indentation != null && indentation.isSetRight()) ? indentation.getRight().intValue()
                : -1;
    }
View Full Code Here

     *
     * @param indentation
     */

    public void setIndentationHanging(int indentation) {
        CTInd indent = getCTInd(true);
        BigInteger bi = new BigInteger("" + indentation);
        indent.setHanging(bi);
    }
View Full Code Here

     * firstLine value is ignored.
     *
     * @return indentation or null if indentation is not set
     */
    public int getIndentationHanging() {
        CTInd indentation = getCTInd(false);
        return (indentation != null && indentation.isSetHanging()) ? indentation.getHanging().intValue() : -1;
    }
View Full Code Here

     * assumed to be zero (if needed).
     *
     * @param indentation
     */
    public void setIndentationFirstLine(int indentation) {
        CTInd indent = getCTInd(true);
        BigInteger bi = new BigInteger("" + indentation);
        indent.setFirstLine(bi);
    }
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.