• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java PPrBase类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.docx4j.wml.PPrBase的典型用法代码示例。如果您正苦于以下问题:Java PPrBase类的具体用法?Java PPrBase怎么用?Java PPrBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

PPrBase类属于org.docx4j.wml包,在下文中一共展示了PPrBase类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createHorizontalLine

点赞 3

import org.docx4j.wml.PPrBase; //导入依赖的package包/类
public static P createHorizontalLine() {

		org.docx4j.wml.ObjectFactory wmlObjectFactory = new org.docx4j.wml.ObjectFactory();

		// Create object for p
		P p = wmlObjectFactory.createP();
		// Create object for pPr
		PPr ppr = wmlObjectFactory.createPPr();
		p.setPPr(ppr);
		// Create object for pBdr
		PPrBase.PBdr pprbasepbdr = wmlObjectFactory.createPPrBasePBdr();
		ppr.setPBdr(pprbasepbdr);
		// Create object for bottom
		CTBorder border = wmlObjectFactory.createCTBorder();
		pprbasepbdr.setBottom(border);
		border.setVal(org.docx4j.wml.STBorder.SINGLE);
		border.setSz(BigInteger.valueOf(6));
		border.setColor("auto");
		border.setSpace(BigInteger.valueOf(1));

		return p;
	}
 

开发者ID:ShapeChange,
项目名称:ShapeChange,
代码行数:23,
代码来源:DocxUtil.java

示例2: createPageNumParagraph

点赞 3

import org.docx4j.wml.PPrBase; //导入依赖的package包/类
private P createPageNumParagraph() {
	 CTSimpleField pgnum = factory.createCTSimpleField();
        pgnum.setInstr(" PAGE \\* MERGEFORMAT ");
        RPr RPr = factory.createRPr();
        RPr.setNoProof(new BooleanDefaultTrue());
        PPr ppr = factory.createPPr();
        Jc jc = factory.createJc();
        jc.setVal(JcEnumeration.CENTER);
        ppr.setJc(jc);
        PPrBase.Spacing pprbase = factory.createPPrBaseSpacing();
        pprbase.setBefore(BigInteger.valueOf(240));
        pprbase.setAfter(BigInteger.valueOf(0));
        ppr.setSpacing(pprbase);
      
        R run = factory.createR();
        run.getContent().add(RPr);
        pgnum.getContent().add(run);

        JAXBElement<CTSimpleField> fldSimple = factory.createPFldSimple(pgnum);
        P para = createParagraph();
        para.getContent().add(fldSimple);
        para.setPPr(ppr);  
        return para;
}
 

开发者ID:nextreports,
项目名称:nextreports-engine,
代码行数:25,
代码来源:DocxExporter.java

示例3: createFillerP

点赞 2

import org.docx4j.wml.PPrBase; //导入依赖的package包/类
private static P createFillerP() {

    	org.docx4j.wml.ObjectFactory wmlObjectFactory = Context.getWmlObjectFactory();

    	P p = wmlObjectFactory.createP(); 
    	    // Create object for pPr
    	    PPr ppr = wmlObjectFactory.createPPr(); 
    	    p.setPPr(ppr); 
    	        // Create object for rPr
    	        ParaRPr pararpr = wmlObjectFactory.createParaRPr(); 

    	        // Create object for spacing
    	        PPrBase.Spacing pprbasespacing = wmlObjectFactory.createPPrBaseSpacing(); 
    	        ppr.setSpacing(pprbasespacing); 
    	            pprbasespacing.setBefore( BigInteger.valueOf( 800) ); 
    	            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); 
    	        r.getContent().add( textWrapped); 
    	            text.setValue( "BODY CONTENT"); 

    	return p;
    }
 

开发者ID:plutext,
项目名称:docx4j-export-FO,
代码行数:36,
代码来源:FOPAreaTreeHelper.java

示例4: apply

点赞 2

import org.docx4j.wml.PPrBase; //导入依赖的package包/类
@Override
public void apply(P p, Object parent, List<Object> siblings) {
	//apply the inline style for each run
	SingleTraversalUtilVisitorCallback runVisitor = new SingleTraversalUtilVisitorCallback(new TraversalUtilRunVisitor());
	runVisitor.walkJAXBElements(p);
	ObjectFactory wmlObjectFactory = new ObjectFactory();
	PPr ppr = p.getPPr();
	if (ppr==null) {
		ppr = wmlObjectFactory.createPPr();
	    p.setPPr(ppr);
	}
	//apply the inline style for run at paragraph level
    if (runWithTextFound) {
    	if (inlineContentStyleIsParagraphStyle) {
		    // Create object for pStyle
		    PPrBase.PStyle pprbasepstyle = wmlObjectFactory.createPPrBasePStyle();
		    ppr.setPStyle(pprbasepstyle);
		    pprbasepstyle.setVal(inlineStyleId);
		    
    	} else {
           // Create object for rStyle
           RStyle rstyle = wmlObjectFactory.createRStyle(); 
           ParaRPr paraRpr = ppr.getRPr();
           if (paraRpr==null) {
	    	paraRpr = wmlObjectFactory.createParaRPr();
	    	ppr.setRPr(paraRpr);
	    }
           paraRpr.setRStyle(rstyle); 
           rstyle.setVal(inlineStyleId); 
    	}
    }
    runWithTextFound = false;
}
 

开发者ID:trackplus,
项目名称:Genji,
代码行数:34,
代码来源:InlineStyleUtil.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)