Examples of RPr


Examples of org.docx4j.wml.RPr

      }
      // Font size and jc for the style following its based on values
      PPr effectivePPr = propertyResolver.getEffectivePPr(styleVal);
      Jc effectiveJc = effectivePPr.getJc();
     
      RPr effectiveRPr = propertyResolver.getEffectiveRPr(styleVal);
      HpsMeasure effectiveFontSize = null;
      if (effectiveRPr!=null) {
        effectiveFontSize=effectiveRPr.getSz();
      }
     
      String tableStyle=null;
      TblPr tblPr = tblStack.peek().getTblPr();
      if (tblPr!=null && tblPr.getTblStyle()!=null) {
View Full Code Here

Examples of org.docx4j.wml.RPr

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

        NodeIterator pPrNodeIt,
        NodeIterator rPrNodeIt,
        NodeIterator textNodeIt) {

    PPr pPr = null;
    RPr rPr = null;
    Text text = null;
     
//      if (rPrNodeIt!=null)
    {
        Node n = pPrNodeIt.nextNode(); //It is never null
View Full Code Here

Examples of org.docx4j.wml.RPr

          // Get the rPr node as a JAXB object,
          // so we can read it using our standard
          // methods.  Its a bit sad that we
          // can't just adorn our DOM tree with the
          // original JAXB objects?
      RPr rPr = null;
          if (rPrNodeIt!=null) { //It is never null
            Node n = rPrNodeIt.nextNode();
            if (n!=null) {
              Unmarshaller u = Context.jc.createUnmarshaller();     
              u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler());
View Full Code Here

Examples of org.docx4j.wml.RPr

      // rPr in pPr direct formatting only applies to paragraph mark,
      // and by virtue of that, to list item label,
      // so pass null here
     
      // Now, work out the value for list item label
      RPr rPrParagraphMark = XmlUtils.deepCopy(rPr);
  //    System.out.println("p rpr-->" + XmlUtils.marshaltoString(pPrDirect.getRPr()));
      if (pPrDirect!=null) {
        StyleUtil.apply(pPrDirect.getRPr(), rPrParagraphMark);       
      }
     
      if (getLog().isDebugEnabled() && pPr!=null) {       
        getLog().debug(XmlUtils.marshaltoString(pPr, true, true));         
      }
                     
      boolean inlist = false;
      boolean indentHandledByNumbering = false;
     
     
      Element foBlockElement = null;
      Element foListBlock = null;
     
//      if (pPr!=null && pPr.getNumPr()!=null ) {
      if (pPr!=null
          && pPr.getNumPr()!=null
          && pPr.getNumPr().getNumId()!=null
          && pPr.getNumPr().getNumId().getVal().longValue()!=0 //zero means no numbering
          ) {
       
        inlist = true;
       
        // Its a list item.  At present we make a new list-block for
        // each list-item. This is not great; DocumentModel will ultimately
        // allow us to use fo:list-block properly.

        foListBlock = document.createElementNS(XSL_FO,
            "list-block");
        currentParent.appendChild(foListBlock);
          // That's different to XSL.
          // Here we end up with block/list-block
          // cf XSL, where the logic avoids creating 2 elements.
          // May be easy to fix, if instead of passing in
          // currentParent, we return block or list-block
          // from here, and appendChild in the calling code.
               
//        foListBlock.setAttribute("provisional-distance-between-starts", "0.5in");
       
        // Need to apply shading at fo:list-block level
        if (pPr.getShd()!=null) {
          PShading pShading = new PShading(pPr.getShd());
          pShading.setXslFO(foListBlock);
        }
       
        Element foListItem = document.createElementNS(XSL_FO,
            "list-item");
        foListBlock.appendChild(foListItem);       

       
        Element foListItemLabel = document.createElementNS(XSL_FO,
            "list-item-label");
        foListItem.appendChild(foListItemLabel);
       
        Element foListItemLabelBody = document.createElementNS(XSL_FO,
            "block");
        foListItemLabel.appendChild(foListItemLabelBody);
       
        Element foListItemBody = document.createElementNS("http://www.w3.org/1999/XSL/Format",
            "fo:list-item-body");
        foListItem.appendChild(foListItemBody)
        foListItemBody.setAttribute(Indent.FO_NAME, "body-start()");       
       
            ResultTriple triple;
            if (pPrDirect!=null && pPrDirect.getNumPr()!=null) {
              triple = org.docx4j.model.listnumbering.Emulator.getNumber(
                conversionContext.getWmlPackage(), pStyleVal,
                pPrDirect.getNumPr().getNumId().getVal().toString(),
                pPrDirect.getNumPr().getIlvl().getVal().toString() );
            } else {
              // Get the effective values; since we already know this,
              // save the effort of doing this again in Emulator
              Ilvl ilvl = pPr.getNumPr().getIlvl();
              String ilvlString = ilvl == null ? "0" : ilvl.getVal().toString();
              triple = null;
              if (pPr.getNumPr().getNumId()!=null) {
                triple = org.docx4j.model.listnumbering.Emulator.getNumber(
                    conversionContext.getWmlPackage(), pStyleVal,
                    pPr.getNumPr().getNumId().getVal().toString(),
                    ilvlString );              
              }
            }
       
        if (triple==null) {
          getLog().warn("computed number ResultTriple was null");
              if (getLog().isDebugEnabled() ) {
                foListItemLabelBody.setTextContent("nrt");
              }
            } else {
             
              /* Format the list item label
               *
               * Since it turns out (in FOP at least) that the label and the body
               * don't have the same vertical alignment
               * unless font size is applied at the same level
               * (ie to both -label and -body, or to the block inside each),
               * we have to format the list-item-body as well.
               * This issue only manifests itself if the font size on
               * the outer list-block is larger than the font sizes
               * set inside it.
               */

              // OK just to override specific values
              // Values come from numbering rPr, unless overridden in p-level rpr
              if(triple.getRPr()==null) {
               
                if (pPr.getRPr()==null) {
                  // do nothing, since we're already inheriting the formatting in the style
                  // (as opposed to the paragraph mark formatting)
                  // EXCEPT for font
                  XsltFOFunctions.setFont( conversionContext,  foListItemLabelBody, pPr, rPr,  triple.getNumString());               
                } else {

                  createFoAttributes(conversionContext.getWmlPackage(), rPrParagraphMark, foListItemLabel );                 
                  createFoAttributes(conversionContext.getWmlPackage(), rPrParagraphMark, foListItemBody );
                 
              XsltFOFunctions.setFont( conversionContext,  foListItemLabelBody, pPr, rPrParagraphMark,  triple.getNumString());                 
                }
               
              } else {
                RPr actual = XmlUtils.deepCopy(triple.getRPr()); // clone, so the ilvl rpr is not altered
//                System.out.println(XmlUtils.marshaltoString(rPrParagraphMark));
               
                // pMark overrides numbering, except for font
                // (which makes sense, since that would change the bullet)
                // so set the font
View Full Code Here

Examples of org.docx4j.wml.RPr

      PropertyResolver propertyResolver = conversionContext.getPropertyResolver();
     
     
        try {
          RPr rPr = propertyResolver.getEffectiveRPr(rPrDirect, pPrDirect);
         
       
      if (getLog().isDebugEnabled() && rPr!=null) {         
        getLog().debug(XmlUtils.marshaltoString(rPr, true, true));         
      }
View Full Code Here

Examples of org.docx4j.wml.RPr

                  pprbasespacing.setAfter( BigInteger.valueOf( 800) );
          // Create object for r
          R r = wmlObjectFactory.createR();
          p.getContent().add( r);
              // Create object for rPr
              RPr rpr = wmlObjectFactory.createRPr();
              r.setRPr(rpr);
                  // Create object for sz
                  HpsMeasure hpsmeasure3 = wmlObjectFactory.createHpsMeasure();
                  rpr.setSz(hpsmeasure3);
                      hpsmeasure3.setVal( BigInteger.valueOf( 96) );

              // Create object for t (wrapped in JAXBElement)
              Text text = wmlObjectFactory.createText();
              JAXBElement<org.docx4j.wml.Text> textWrapped = wmlObjectFactory.createRT(text);
View Full Code Here

Examples of org.docx4j.wml.RPr

     
      PropertyResolver propertyResolver = wordMLPackage.getMainDocumentPart().getPropertyResolver();
     
//      Style pStyle = null;
      String pStyleId = null;
      RPr pRPr = null;
      if (pPr==null || pPr.getPStyle()==null) {
//        pStyle = getDefaultPStyle();
        if (getDefaultPStyle() == null) {
          log.warn("getDefaultPStyle() returned null");
        } else {
View Full Code Here

Examples of org.docx4j.wml.RPr

    FontScheme fontScheme) {
   
    ObjectFactory factory = Context.getWmlObjectFactory();

//    <w:rPr>
    RPr rPr = factory.createRPr();

    if (lvlPPr.getDefRPr()!=null) { 
   
//    *sz hundreds of pt
//    <w:sz w:val="28" />
      if (lvlPPr.getDefRPr().getSz()!=null) {       
        rPr.setSz( convertFontSize(lvlPPr.getDefRPr().getSz()) );
      }
     
//    kern
//    solidFill
   
//    *latin       
//    <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />
      if (lvlPPr.getDefRPr().getLatin()!=null ) {
        RFonts rFonts = factory.createRFonts();
        if (lvlPPr.getDefRPr().getLatin().getTypeface().startsWith("+mj") ) {         
          rFonts.setAscii( fontScheme.getMajorFont().getLatin().getTypeface() );
        } else if (lvlPPr.getDefRPr().getLatin().getTypeface().startsWith("+mn") ) {         
          rFonts.setAscii( fontScheme.getMinorFont().getLatin().getTypeface() );
       
        rPr.setRFonts(rFonts);
      }     
    }
 
    return rPr;
 
View Full Code Here

Examples of org.docx4j.wml.RPr

    Name styleName = factory.createStyleName();
    styleName.setVal(ROOT_NAME);
    style.setName(styleName);
   
//    <w:rPr>
    RPr rPr = factory.createRPr();
    style.setRPr(rPr);

//    <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />
    RFonts rFonts = factory.createRFonts();
    rFonts.setAscii( fontScheme.getMinorFont().getLatin().getTypeface() );
    rPr.setRFonts(rFonts);
 
    return style;
     
   
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.