Search in sources :

Example 46 with PPr

use of org.docx4j.wml.PPr in project docx4j-template by vindell.

the class Docx4j_工具类_S3_Test method setParagraphSuppressLineNum.

/**
 * @Description: 设置段落是否禁止行号(禁止用于当前行号)
 */
public void setParagraphSuppressLineNum(P p) {
    PPr ppr = getPPr(p);
    BooleanDefaultTrue line = ppr.getSuppressLineNumbers();
    if (line == null) {
        line = new BooleanDefaultTrue();
    }
    line.setVal(true);
    ppr.setSuppressLineNumbers(line);
}
Also used : PPr(org.docx4j.wml.PPr) BooleanDefaultTrue(org.docx4j.wml.BooleanDefaultTrue)

Example 47 with PPr

use of org.docx4j.wml.PPr in project docx4j-template by vindell.

the class Docx4j_工具类_S3_Test method setParaJcAlign.

/**
 * @Description: 设置段落水平对齐方式
 */
public void setParaJcAlign(P paragraph, JcEnumeration hAlign) {
    if (hAlign != null) {
        PPr pprop = paragraph.getPPr();
        if (pprop == null) {
            pprop = new PPr();
            paragraph.setPPr(pprop);
        }
        Jc align = new Jc();
        align.setVal(hAlign);
        pprop.setJc(align);
    }
}
Also used : PPr(org.docx4j.wml.PPr) STVerticalJc(org.docx4j.wml.STVerticalJc) Jc(org.docx4j.wml.Jc) CTVerticalJc(org.docx4j.wml.CTVerticalJc)

Example 48 with PPr

use of org.docx4j.wml.PPr in project docx4j-template by vindell.

the class HtmlToDOCDemo method setWmlPprSetting.

public static void setWmlPprSetting(Object source, List<Object> targetList) {
    PPr sourcePpr = getWmlObjectPpr(source);
    if (sourcePpr != null) {
        for (int i = 0, iSize = targetList.size(); i < iSize; i++) {
            PPr ppr = getWmlObjectPpr(targetList.get(i));
            if (ppr != null) {
                ppr.setInd(sourcePpr.getInd());
                ppr.setSpacing(sourcePpr.getSpacing());
            }
        }
    }
// sourcePpr.getSpacing()
}
Also used : PPr(org.docx4j.wml.PPr)

Aggregations

PPr (org.docx4j.wml.PPr)48 Jc (org.docx4j.wml.Jc)29 R (org.docx4j.wml.R)23 P (org.docx4j.wml.P)22 CTVerticalJc (org.docx4j.wml.CTVerticalJc)21 STVerticalJc (org.docx4j.wml.STVerticalJc)20 BigInteger (java.math.BigInteger)17 Text (org.docx4j.wml.Text)14 PBdr (org.docx4j.wml.PPrBase.PBdr)10 CTBorder (org.docx4j.wml.CTBorder)9 RPr (org.docx4j.wml.RPr)6 Inline (org.docx4j.dml.wordprocessingDrawing.Inline)5 BinaryPartAbstractImage (org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage)5 Drawing (org.docx4j.wml.Drawing)5 Spacing (org.docx4j.wml.PPrBase.Spacing)5 Ftr (org.docx4j.wml.Ftr)4 ObjectFactory (org.docx4j.wml.ObjectFactory)4 ParaRPr (org.docx4j.wml.ParaRPr)4 Ind (org.docx4j.wml.PPrBase.Ind)3 Tc (org.docx4j.wml.Tc)3