Examples of PPr


Examples of org.docx4j.wml.PPr

   
    // Add a sectPr   
    org.docx4j.wml.P  par = objectFactory.createP();
    mainContent.add(0,par);
    SectPr sectPr = objectFactory.createSectPr();
    PPr ppr = objectFactory.createPPr();
    ppr.setSectPr(sectPr);
    par.setPPr(ppr);
   
   
    // From the spec, if this element is set to true and the
    // first page header type is omitted, then a blank header
View Full Code Here

Examples of org.docx4j.wml.PPr

  }
 
  public static PPr getWmlPPr(CTTextParagraphProperties lvlPPr ) {
   
    ObjectFactory factory = Context.getWmlObjectFactory();
    PPr pPr = factory.createPPr();   
   
//    *marL eg 342900 EMU
//    *indent eg -342900
   
//    *algn l|ctr|r
    if (lvlPPr.getAlgn()!=null) {
      Jc jc = factory.createJc();
      String algn = lvlPPr.getAlgn().value();
      log.debug("algn: " + algn);
      if algn.equals("l")) {
        jc.setVal(JcEnumeration.LEFT);
      } else if (algn.equals("ctr")) {
        jc.setVal(JcEnumeration.CENTER);
      } else if (algn.equals("r")) {
        jc.setVal(JcEnumeration.RIGHT);
  //    } else if (value.getCssText().toLowerCase().equals("justify")) {
  //      jc.setVal(JcEnumeration.BOTH);
      } else {
        log.warn("How to handle algn: " + algn);
      }   
      pPr.setJc( jc );
    }
   
//    defTabSz eg 914400 EMU = 1 inch
//    hangingPunct?

View Full Code Here

Examples of org.docx4j.wml.PPr

        log.debug(
            XmlUtils.marshaltoString(lvlPPr, true, true,
                Context.jcPML, "FIXME", "lvl1pPr",
                CTTextParagraphProperties.class)
            );
        PPr pPr = TextStyles.getWmlPPr(lvlPPr);
        if (pPr!=null) {
          HtmlCssHelper.createCss(context.getPmlPackage(), pPr, inlineStyle, false);       
        }
        // TODO RPR
      }
View Full Code Here

Examples of org.docx4j.wml.PPr

    String styleId = defaultParagraphStyleId;
   
    fillPPrStack(styleId, pPrStack);
    pPrStack.push(documentDefaultPPr);
     
    PPr effectivePPr = factory.createPPr();     
    // Now, apply the properties starting at the top of the stack
    while (!pPrStack.empty() ) {
      PPr pPr = pPrStack.pop();
      applyPPr(pPr, effectivePPr);
    }
    resolvedStylePPrComponent.put(styleId, effectivePPr);   
  }
View Full Code Here

Examples of org.docx4j.wml.PPr

   * @param expressPPr
   * @return
   */
  public PPr getEffectivePPr(PPr expressPPr) {
   
    PPr effectivePPr = null;
    //  First, the document defaults are applied
   
      // Done elsewhere
      // PPr effectivePPr = (PPr)XmlUtils.deepCopy(documentDefaultPPr);
   
    //  Next, the table style properties are applied to each table in the document,
    //  following the conditional formatting inclusions and exclusions specified
    //  per table.
   
      // TODO - if the paragraph is in a table?
       
    //  Next, numbered item and paragraph properties are applied to each paragraph
    //  formatted with a *numbering *style**.
   
      // TODO - who uses numbering styles (as opposed to numbering
      // via a paragraph style or direct formatting)?
   
    //  Next, paragraph and run properties are
    //  applied to each paragraph as defined by the paragraph style.
    PPr resolvedPPr = null;
    String styleId;
    if (expressPPr == null || expressPPr.getPStyle() == null ) {
//      styleId = "Normal";
      styleId = defaultParagraphStyleId;
     
View Full Code Here

Examples of org.docx4j.wml.PPr

   * @param expressPPr
   * @return
   */
  public PPr getEffectivePPr(String styleId) {
   
    PPr resolvedPPr = resolvedStylePPrComponent.get(styleId);
   
    if (resolvedPPr!=null) {
      return resolvedPPr;
    }
   
    // Hmm, have to do the work
    Style s = liveStyles.get(styleId);
   
    if (s==null) {
      log.error("Couldn't find style: " + styleId);
      return null;
    }
   
//    PPr expressPPr = s.getPPr();
//    if (expressPPr==null) {
//      // A paragraph style may have no w:pPr component
//      log.debug("style: " + styleId + " has no PPr");
//      String normalId = this.styleDefinitionsPart.getDefaultParagraphStyle().getStyleId();     
//      resolvedPPr = resolvedStylePPrComponent.get(normalId);
//      return resolvedPPr;
//    }
   
    //  Next, paragraph and run properties are
    //  applied to each paragraph as defined by the paragraph style.
    Stack<PPr> pPrStack = new Stack<PPr>();
    // Haven't done this one yet       
    fillPPrStack(styleId, pPrStack);
    // Finally, on top
    pPrStack.push(documentDefaultPPr);
           
    resolvedPPr = factory.createPPr();     
    // Now, apply the properties starting at the top of the stack
    while (!pPrStack.empty() ) {
      PPr pPr = pPrStack.pop();
      applyPPr(pPr, resolvedPPr);
    }
    resolvedStylePPrComponent.put(styleId, resolvedPPr);
    return resolvedPPr;
  }
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.