Examples of PPr


Examples of org.docx4j.wml.PPr

      Unmarshaller u = Context.jc.createUnmarshaller();     
      u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler());

      // If there is w:pPr/w:pStyle,     
      // we need to honour any rPr in the pStyle
      PPr pPrDirect = null;
          if (pPrNodeIt!=null) {
            Node n = pPrNodeIt.nextNode();
            if (n!=null) {
              Object jaxb = u.unmarshal(n);
              try {
View Full Code Here

Examples of org.docx4j.wml.PPr

   
    Object o = body.getContent().get(0);
   
    if (o instanceof P
        && ((P)o).getPPr()!=null) {
      PPr pPr = ((P)o).getPPr();
      BooleanDefaultTrue val = new BooleanDefaultTrue();
      val.setVal(Boolean.FALSE);
      pPr.setPageBreakBefore(val);
    }
  }
View Full Code Here

Examples of org.docx4j.wml.PPr

    // For each w:p, test w:r/w:t
    for (int i=0; i<document.getContent().size(); i++) {
     
      P p = (P)document.getContent().get(i);
     
      PPr pPr = p.getPPr();
      RPr rPr = ((R)p.getContent().get(0)).getRPr();
     
      Text wmlText = (Text)XmlUtils.unwrap(((R)p.getContent().get(0)).getContent().get(0));
     
      log.debug(wmlText.getValue());
View Full Code Here

Examples of org.docx4j.wml.PPr

          if (block instanceof P && ((P) block).getPPr() != null
              && ((P) block).getPPr().getSectPr() != null) {
            makeContinuous(((P) block).getPPr().getSectPr());
          } else if (block instanceof P) {
            // More likely
            PPr ppr = ((P) block).getPPr();
            if (ppr == null) {
              ppr = Context.getWmlObjectFactory().createPPr();
              ((P) block).setPPr(ppr);
            }
            SectPr newSectPr = Context.getWmlObjectFactory()
                .createSectPr();
            SectPr.Type type = Context.getWmlObjectFactory()
                .createSectPrType();
            type.setVal("continuous");
            newSectPr.setType(type);

            ppr.setSectPr(newSectPr);
          } else {
            // Equally likely - its a table or something, so add a p
            P newP = Context.getWmlObjectFactory().createP();
            PPr ppr = Context.getWmlObjectFactory().createPPr();
            newP.setPPr(ppr);

            SectPr newSectPr = Context.getWmlObjectFactory()
                .createSectPr();
            SectPr.Type type = Context.getWmlObjectFactory()
                .createSectPrType();
            type.setVal("continuous");
            newSectPr.setType(type);
            ppr.setSectPr(newSectPr);

            bodyChildren.add(indexIntoBody.intValue(), newP); // add
                                      // before
                                      // altChunk
          }
View Full Code Here

Examples of org.docx4j.wml.PPr

    // For each w:p, test w:r/w:t
    for (int i=0; i<document.getContent().size(); i++) {
     
      P p = (P)document.getContent().get(i);
     
      PPr pPr = p.getPPr();
      RPr rPr = ((R)p.getContent().get(0)).getRPr();
     
      Text wmlText = (Text)XmlUtils.unwrap(((R)p.getContent().get(0)).getContent().get(0));
     
      log.debug(wmlText.getValue());
View Full Code Here

Examples of org.docx4j.wml.PPr

    // For each w:p, test w:r/w:t
    for (int i=0; i<document.getContent().size(); i++) {
     
      P p = (P)document.getContent().get(i);
     
      PPr pPr = p.getPPr();
      RPr rPr = ((R)p.getContent().get(0)).getRPr();
     
      Text wmlText = (Text)XmlUtils.unwrap(((R)p.getContent().get(0)).getContent().get(0));
     
      log.debug(wmlText.getValue());
View Full Code Here

Examples of org.docx4j.wml.PPr

       */
         
      if (o instanceof P) {
       
        paragraph = (P)o;       
        PPr ppr = propertyResolver.getEffectivePPr(paragraph.getPPr());
       
        NumPr numPr = ppr.getNumPr();
       
        if (numPr==null) {
          closeAllLists();
          resultElts.add(o);
          continue;
View Full Code Here

Examples of org.docx4j.wml.PPr

   
    for(Object o :  contentIn) {
     
      if (o instanceof P) {
        P p = (P)o;
        PPr effPPr = getEffectivePPr(p);
       
//        if (inList) {
//         
//          if (isListItem(effPPr)) {
//            // still in list; continue
//           
//          } else {
//            inList = false; // now continue
//          }
//         
//        } else {

          if (isListItem(effPPr)) {
            inList = true;
           
            if (hasBreakBefore(effPPr)) {
              // insert a p containing a break
              P newP = new P();
              newP.setPPr(new PPr());
              newP.getPPr().setPageBreakBefore(new BooleanDefaultTrue());
              newContent.add(newP);
             
              // turn off PageBreakBefore in this p
              PPr pPr = p.getPPr();
              if (pPr == null) {
                pPr = Context.getWmlObjectFactory().createPPr();
                p.setPPr(pPr);
              }
              BooleanDefaultTrue val = new BooleanDefaultTrue();
              val.setVal(Boolean.FALSE);
              pPr.setPageBreakBefore(val);
            }
          } else {
            // inList still false; // now continue
          }
         
View Full Code Here

Examples of org.docx4j.wml.PPr

    return newContent;
  }
 
  private PPr getEffectivePPr(P p) {

    PPr pPrDirect = p.getPPr();
        return propertyResolver.getEffectivePPr(pPrDirect)
  }
View Full Code Here

Examples of org.docx4j.wml.PPr

    // For each w:p, test w:r/w:t
    for (int i=0; i<document.getContent().size(); i++) {
     
      P p = (P)document.getContent().get(i);
     
      PPr pPr = p.getPPr();
      RPr rPr = ((R)p.getContent().get(0)).getRPr();
     
      Text wmlText = (Text)XmlUtils.unwrap(((R)p.getContent().get(0)).getContent().get(0));
     
      log.debug(wmlText.getValue());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.