Package org.openxmlformats.schemas.wordprocessingml.x2006.main

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPicture


        XWPFParagraph p = doc.createParagraph();

        assertEquals(-1, p.getIndentationLeft());

        CTP ctp = p.getCTP();
        CTPPr ppr = ctp.getPPr()== null? ctp.addNewPPr() : ctp.getPPr();

        assertEquals(-1, p.getIndentationLeft());

        CTInd ind = ppr.addNewInd();
        ind.setLeft(new BigInteger("10"));
        assertEquals(10, p.getIndentationLeft());

        p.setIndentationLeft(100);
        assertEquals(100, ind.getLeft().intValue());
View Full Code Here


        //new clean instance of paragraph
        XWPFDocument doc = new XWPFDocument();
        XWPFParagraph p = doc.createParagraph();

        CTP ctp = p.getCTP();
        CTPPr ppr = ctp.getPPr()== null? ctp.addNewPPr() : ctp.getPPr();

        CTTextAlignment txtAlign = ppr.addNewTextAlignment();
        txtAlign.setVal(STTextAlignment.CENTER);
        assertEquals(TextAlignment.CENTER, p.getVerticalAlignment());

        p.setVerticalAlignment(TextAlignment.BOTTOM);
        assertEquals(STTextAlignment.BOTTOM, ppr.getTextAlignment().getVal());
    }
View Full Code Here

    public void testSetGetWordWrap() {
        XWPFDocument doc = new XWPFDocument();
        XWPFParagraph p = doc.createParagraph();

        CTP ctp = p.getCTP();
        CTPPr ppr = ctp.getPPr()== null? ctp.addNewPPr() : ctp.getPPr();

        CTOnOff wordWrap = ppr.addNewWordWrap();
        wordWrap.setVal(STOnOff.FALSE);
        assertEquals(false, p.isWordWrap());

        p.setWordWrap(true);
        assertEquals(STOnOff.TRUE, ppr.getWordWrap().getVal());
    }
View Full Code Here

    public void testSetGetPageBreak() {
        XWPFDocument doc = new XWPFDocument();
        XWPFParagraph p = doc.createParagraph();

        CTP ctp = p.getCTP();
        CTPPr ppr = ctp.getPPr()== null? ctp.addNewPPr() : ctp.getPPr();

        CTOnOff pageBreak = ppr.addNewPageBreakBefore();
        pageBreak.setVal(STOnOff.FALSE);
        assertEquals(false, p.isPageBreak());

        p.setPageBreak(true);
        assertEquals(STOnOff.TRUE, ppr.getPageBreakBefore().getVal());
    }
View Full Code Here

    pPr.addNewPStyle().setVal("Header");
    // start watermark paragraph
    CTR r = p.addNewR();
    CTRPr rPr = r.addNewRPr();
    rPr.addNewNoProof();
    CTPicture pict = r.addNewPict();
    CTGroup group = CTGroup.Factory.newInstance();
    CTShapetype shapetype = group.addNewShapetype();
    shapetype.setId("_x0000_t136");
    shapetype.setCoordsize("1600,21600");
    shapetype.setSpt(136);
    shapetype.setAdj("10800");
    shapetype.setPath2("m@7,0l@8,0m@5,21600l@6,21600e");
    CTFormulas formulas = shapetype.addNewFormulas();
    formulas.addNewF().setEqn("sum #0 0 10800");
    formulas.addNewF().setEqn("prod #0 2 1");
    formulas.addNewF().setEqn("sum 21600 0 @1");
    formulas.addNewF().setEqn("sum 0 0 @2");
    formulas.addNewF().setEqn("sum 21600 0 @3");
    formulas.addNewF().setEqn("if @0 @3 0");
    formulas.addNewF().setEqn("if @0 21600 @1");
    formulas.addNewF().setEqn("if @0 0 @2");
    formulas.addNewF().setEqn("if @0 @4 21600");
    formulas.addNewF().setEqn("mid @5 @6");
    formulas.addNewF().setEqn("mid @8 @5");
    formulas.addNewF().setEqn("mid @7 @8");
    formulas.addNewF().setEqn("mid @6 @7");
    formulas.addNewF().setEqn("sum @6 0 @5");
    CTPath path = shapetype.addNewPath();
    path.setTextpathok(STTrueFalse.T);
    path.setConnecttype(STConnectType.CUSTOM);
    path.setConnectlocs("@9,0;@10,10800;@11,21600;@12,10800");
    path.setConnectangles("270,180,90,0");
    CTTextPath shapeTypeTextPath = shapetype.addNewTextpath();
    shapeTypeTextPath.setOn(STTrueFalse.T);
    shapeTypeTextPath.setFitshape(STTrueFalse.T);
    CTHandles handles = shapetype.addNewHandles();
    CTH h = handles.addNewH();
    h.setPosition("#0,bottomRight");
    h.setXrange("6629,14971");
    CTLock lock = shapetype.addNewLock();
    lock.setExt(STExt.EDIT);
    CTShape shape = group.addNewShape();
    shape.setId("PowerPlusWaterMarkObject" + idx);
    shape.setSpid("_x0000_s102" + (4+idx));
    shape.setType("#_x0000_t136");
    shape.setStyle("position:absolute;margin-left:0;margin-top:0;width:415pt;height:207.5pt;z-index:-251654144;mso-wrap-edited:f;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin");
    shape.setWrapcoords("616 5068 390 16297 39 16921 -39 17155 7265 17545 7186 17467 -39 17467 18904 17467 10507 17467 8710 17545 18904 17077 18787 16843 18358 16297 18279 12554 19178 12476 20701 11774 20779 11228 21131 10059 21248 8811 21248 7563 20975 6316 20935 5380 19490 5146 14022 5068 2616 5068");
    shape.setFillcolor("black");
    shape.setStroked(STTrueFalse.FALSE);
    CTTextPath shapeTextPath = shape.addNewTextpath();
    shapeTextPath.setStyle("font-family:"Cambria";font-size:1pt");
    shapeTextPath.setString(text);
    pict.set(group);
    // end watermark paragraph
    return new XWPFParagraph(p, doc);
  }
View Full Code Here

    pPr.addNewPStyle().setVal("Header");
    // start watermark paragraph
    CTR r = p.addNewR();
    CTRPr rPr = r.addNewRPr();
    rPr.addNewNoProof();
    CTPicture pict = r.addNewPict();
    CTGroup group = CTGroup.Factory.newInstance();
    CTShapetype shapetype = group.addNewShapetype();
    shapetype.setId("_x0000_t136");
    shapetype.setCoordsize("1600,21600");
    shapetype.setSpt(136);
    shapetype.setAdj("10800");
    shapetype.setPath2("m@7,0l@8,0m@5,21600l@6,21600e");
    CTFormulas formulas = shapetype.addNewFormulas();
    formulas.addNewF().setEqn("sum #0 0 10800");
    formulas.addNewF().setEqn("prod #0 2 1");
    formulas.addNewF().setEqn("sum 21600 0 @1");
    formulas.addNewF().setEqn("sum 0 0 @2");
    formulas.addNewF().setEqn("sum 21600 0 @3");
    formulas.addNewF().setEqn("if @0 @3 0");
    formulas.addNewF().setEqn("if @0 21600 @1");
    formulas.addNewF().setEqn("if @0 0 @2");
    formulas.addNewF().setEqn("if @0 @4 21600");
    formulas.addNewF().setEqn("mid @5 @6");
    formulas.addNewF().setEqn("mid @8 @5");
    formulas.addNewF().setEqn("mid @7 @8");
    formulas.addNewF().setEqn("mid @6 @7");
    formulas.addNewF().setEqn("sum @6 0 @5");
    CTPath path = shapetype.addNewPath();
    path.setTextpathok(STTrueFalse.T);
    path.setConnecttype(STConnectType.CUSTOM);
    path.setConnectlocs("@9,0;@10,10800;@11,21600;@12,10800");
    path.setConnectangles("270,180,90,0");
    CTTextPath shapeTypeTextPath = shapetype.addNewTextpath();
    shapeTypeTextPath.setOn(STTrueFalse.T);
    shapeTypeTextPath.setFitshape(STTrueFalse.T);
    CTHandles handles = shapetype.addNewHandles();
    CTH h = handles.addNewH();
    h.setPosition("#0,bottomRight");
    h.setXrange("6629,14971");
    CTLock lock = shapetype.addNewLock();
    lock.setExt(STExt.EDIT);
    CTShape shape = group.addNewShape();
    shape.setId("PowerPlusWaterMarkObject" + idx);
    shape.setSpid("_x0000_s102" + (4+idx));
    shape.setType("#_x0000_t136");
    shape.setStyle("position:absolute;margin-left:0;margin-top:0;width:415pt;height:207.5pt;z-index:-251654144;mso-wrap-edited:f;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin");
    shape.setWrapcoords("616 5068 390 16297 39 16921 -39 17155 7265 17545 7186 17467 -39 17467 18904 17467 10507 17467 8710 17545 18904 17077 18787 16843 18358 16297 18279 12554 19178 12476 20701 11774 20779 11228 21131 10059 21248 8811 21248 7563 20975 6316 20935 5380 19490 5146 14022 5068 2616 5068");
    shape.setFillcolor("black");
    shape.setStroked(STTrueFalse.FALSE);
    CTTextPath shapeTextPath = shape.addNewTextpath();
    shapeTextPath.setStyle("font-family:"Cambria";font-size:1pt");
    shapeTextPath.setString(text);
    pict.set(group);
    // end watermark paragraph
    return new XWPFParagraph(p);
  }
View Full Code Here

        pPr.addNewPStyle().setVal("Header");
        // start watermark paragraph
        CTR r = p.addNewR();
        CTRPr rPr = r.addNewRPr();
        rPr.addNewNoProof();
        CTPicture pict = r.addNewPict();
        CTGroup group = CTGroup.Factory.newInstance();
        CTShapetype shapetype = group.addNewShapetype();
        shapetype.setId("_x0000_t136");
        shapetype.setCoordsize("1600,21600");
        shapetype.setSpt(136);
        shapetype.setAdj("10800");
        shapetype.setPath2("m@7,0l@8,0m@5,21600l@6,21600e");
        CTFormulas formulas = shapetype.addNewFormulas();
        formulas.addNewF().setEqn("sum #0 0 10800");
        formulas.addNewF().setEqn("prod #0 2 1");
        formulas.addNewF().setEqn("sum 21600 0 @1");
        formulas.addNewF().setEqn("sum 0 0 @2");
        formulas.addNewF().setEqn("sum 21600 0 @3");
        formulas.addNewF().setEqn("if @0 @3 0");
        formulas.addNewF().setEqn("if @0 21600 @1");
        formulas.addNewF().setEqn("if @0 0 @2");
        formulas.addNewF().setEqn("if @0 @4 21600");
        formulas.addNewF().setEqn("mid @5 @6");
        formulas.addNewF().setEqn("mid @8 @5");
        formulas.addNewF().setEqn("mid @7 @8");
        formulas.addNewF().setEqn("mid @6 @7");
        formulas.addNewF().setEqn("sum @6 0 @5");
        CTPath path = shapetype.addNewPath();
        path.setTextpathok(STTrueFalse.T);
        path.setConnecttype(STConnectType.CUSTOM);
        path.setConnectlocs("@9,0;@10,10800;@11,21600;@12,10800");
        path.setConnectangles("270,180,90,0");
        CTTextPath shapeTypeTextPath = shapetype.addNewTextpath();
        shapeTypeTextPath.setOn(STTrueFalse.T);
        shapeTypeTextPath.setFitshape(STTrueFalse.T);
        CTHandles handles = shapetype.addNewHandles();
        CTH h = handles.addNewH();
        h.setPosition("#0,bottomRight");
        h.setXrange("6629,14971");
        CTLock lock = shapetype.addNewLock();
        lock.setExt(STExt.EDIT);
        CTShape shape = group.addNewShape();
        shape.setId("PowerPlusWaterMarkObject" + idx);
        shape.setSpid("_x0000_s102" + (4+idx));
        shape.setType("#_x0000_t136");
        shape.setStyle("position:absolute;margin-left:0;margin-top:0;width:415pt;height:207.5pt;z-index:-251654144;mso-wrap-edited:f;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin");
        shape.setWrapcoords("616 5068 390 16297 39 16921 -39 17155 7265 17545 7186 17467 -39 17467 18904 17467 10507 17467 8710 17545 18904 17077 18787 16843 18358 16297 18279 12554 19178 12476 20701 11774 20779 11228 21131 10059 21248 8811 21248 7563 20975 6316 20935 5380 19490 5146 14022 5068 2616 5068");
        shape.setFillcolor("black");
        shape.setStroked(STTrueFalse.FALSE);
        CTTextPath shapeTextPath = shape.addNewTextpath();
        shapeTextPath.setStyle("font-family:"Cambria";font-size:1pt");
        shapeTextPath.setString(text);
        pict.set(group);
        // end watermark paragraph
        return new XWPFParagraph(p, doc);
    }
View Full Code Here

    pPr.addNewPStyle().setVal("Header");
    // start watermark paragraph
    CTR r = p.addNewR();
    CTRPr rPr = r.addNewRPr();
    rPr.addNewNoProof();
    CTPicture pict = r.addNewPict();
    CTGroup group = CTGroup.Factory.newInstance();
    CTShapetype shapetype = group.addNewShapetype();
    shapetype.setId("_x0000_t136");
    shapetype.setCoordsize("1600,21600");
    shapetype.setSpt(136);
    shapetype.setAdj("10800");
    shapetype.setPath2("m@7,0l@8,0m@5,21600l@6,21600e");
    CTFormulas formulas = shapetype.addNewFormulas();
    formulas.addNewF().setEqn("sum #0 0 10800");
    formulas.addNewF().setEqn("prod #0 2 1");
    formulas.addNewF().setEqn("sum 21600 0 @1");
    formulas.addNewF().setEqn("sum 0 0 @2");
    formulas.addNewF().setEqn("sum 21600 0 @3");
    formulas.addNewF().setEqn("if @0 @3 0");
    formulas.addNewF().setEqn("if @0 21600 @1");
    formulas.addNewF().setEqn("if @0 0 @2");
    formulas.addNewF().setEqn("if @0 @4 21600");
    formulas.addNewF().setEqn("mid @5 @6");
    formulas.addNewF().setEqn("mid @8 @5");
    formulas.addNewF().setEqn("mid @7 @8");
    formulas.addNewF().setEqn("mid @6 @7");
    formulas.addNewF().setEqn("sum @6 0 @5");
    CTPath path = shapetype.addNewPath();
    path.setTextpathok(STTrueFalse.T);
    path.setConnecttype(STConnectType.CUSTOM);
    path.setConnectlocs("@9,0;@10,10800;@11,21600;@12,10800");
    path.setConnectangles("270,180,90,0");
    CTTextPath shapeTypeTextPath = shapetype.addNewTextpath();
    shapeTypeTextPath.setOn(STTrueFalse.T);
    shapeTypeTextPath.setFitshape(STTrueFalse.T);
    CTHandles handles = shapetype.addNewHandles();
    CTH h = handles.addNewH();
    h.setPosition("#0,bottomRight");
    h.setXrange("6629,14971");
    CTLock lock = shapetype.addNewLock();
    lock.setExt(STExt.EDIT);
    CTShape shape = group.addNewShape();
    shape.setId("PowerPlusWaterMarkObject" + idx);
    shape.setSpid("_x0000_s102" + (4+idx));
    shape.setType("#_x0000_t136");
    shape.setStyle("position:absolute;margin-left:0;margin-top:0;width:415pt;height:207.5pt;z-index:-251654144;mso-wrap-edited:f;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin");
    shape.setWrapcoords("616 5068 390 16297 39 16921 -39 17155 7265 17545 7186 17467 -39 17467 18904 17467 10507 17467 8710 17545 18904 17077 18787 16843 18358 16297 18279 12554 19178 12476 20701 11774 20779 11228 21131 10059 21248 8811 21248 7563 20975 6316 20935 5380 19490 5146 14022 5068 2616 5068");
    shape.setFillcolor("black");
    shape.setStroked(STTrueFalse.FALSE);
    CTTextPath shapeTextPath = shape.addNewTextpath();
    shapeTextPath.setStyle("font-family:"Cambria";font-size:1pt");
    shapeTextPath.setString(text);
    pict.set(group);
    // end watermark paragraph
    return new XWPFParagraph(p);
  }
View Full Code Here

    pPr.addNewPStyle().setVal("Header");
    // start watermark paragraph
    CTR r = p.addNewR();
    CTRPr rPr = r.addNewRPr();
    rPr.addNewNoProof();
    CTPicture pict = r.addNewPict();
    CTGroup group = CTGroup.Factory.newInstance();
    CTShapetype shapetype = group.addNewShapetype();
    shapetype.setId("_x0000_t136");
    shapetype.setCoordsize("1600,21600");
    shapetype.setSpt(136);
    shapetype.setAdj("10800");
    shapetype.setPath2("m@7,0l@8,0m@5,21600l@6,21600e");
    CTFormulas formulas = shapetype.addNewFormulas();
    formulas.addNewF().setEqn("sum #0 0 10800");
    formulas.addNewF().setEqn("prod #0 2 1");
    formulas.addNewF().setEqn("sum 21600 0 @1");
    formulas.addNewF().setEqn("sum 0 0 @2");
    formulas.addNewF().setEqn("sum 21600 0 @3");
    formulas.addNewF().setEqn("if @0 @3 0");
    formulas.addNewF().setEqn("if @0 21600 @1");
    formulas.addNewF().setEqn("if @0 0 @2");
    formulas.addNewF().setEqn("if @0 @4 21600");
    formulas.addNewF().setEqn("mid @5 @6");
    formulas.addNewF().setEqn("mid @8 @5");
    formulas.addNewF().setEqn("mid @7 @8");
    formulas.addNewF().setEqn("mid @6 @7");
    formulas.addNewF().setEqn("sum @6 0 @5");
    CTPath path = shapetype.addNewPath();
    path.setTextpathok(STTrueFalse.T);
    path.setConnecttype(STConnectType.CUSTOM);
    path.setConnectlocs("@9,0;@10,10800;@11,21600;@12,10800");
    path.setConnectangles("270,180,90,0");
    CTTextPath shapeTypeTextPath = shapetype.addNewTextpath();
    shapeTypeTextPath.setOn(STTrueFalse.T);
    shapeTypeTextPath.setFitshape(STTrueFalse.T);
    CTHandles handles = shapetype.addNewHandles();
    CTH h = handles.addNewH();
    h.setPosition("#0,bottomRight");
    h.setXrange("6629,14971");
    CTLock lock = shapetype.addNewLock();
    lock.setExt(STExt.EDIT);
    CTShape shape = group.addNewShape();
    shape.setId("PowerPlusWaterMarkObject" + idx);
    shape.setSpid("_x0000_s102" + (4+idx));
    shape.setType("#_x0000_t136");
    shape.setStyle("position:absolute;margin-left:0;margin-top:0;width:415pt;height:207.5pt;z-index:-251654144;mso-wrap-edited:f;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin");
    shape.setWrapcoords("616 5068 390 16297 39 16921 -39 17155 7265 17545 7186 17467 -39 17467 18904 17467 10507 17467 8710 17545 18904 17077 18787 16843 18358 16297 18279 12554 19178 12476 20701 11774 20779 11228 21131 10059 21248 8811 21248 7563 20975 6316 20935 5380 19490 5146 14022 5068 2616 5068");
    shape.setFillcolor("black");
    shape.setStroked(STTrueFalse.FALSE);
    CTTextPath shapeTextPath = shape.addNewTextpath();
    shapeTextPath.setStyle("font-family:"Cambria";font-size:1pt");
    shapeTextPath.setString(text);
    pict.set(group);
    // end watermark paragraph
    return new XWPFParagraph(p, null);
  }
View Full Code Here

    pPr.addNewPStyle().setVal("Header");
    // start watermark paragraph
    CTR r = p.addNewR();
    CTRPr rPr = r.addNewRPr();
    rPr.addNewNoProof();
    CTPicture pict = r.addNewPict();
    CTGroup group = CTGroup.Factory.newInstance();
    CTShapetype shapetype = group.addNewShapetype();
    shapetype.setId("_x0000_t136");
    shapetype.setCoordsize("1600,21600");
    shapetype.setSpt(136);
    shapetype.setAdj("10800");
    shapetype.setPath2("m@7,0l@8,0m@5,21600l@6,21600e");
    CTFormulas formulas = shapetype.addNewFormulas();
    formulas.addNewF().setEqn("sum #0 0 10800");
    formulas.addNewF().setEqn("prod #0 2 1");
    formulas.addNewF().setEqn("sum 21600 0 @1");
    formulas.addNewF().setEqn("sum 0 0 @2");
    formulas.addNewF().setEqn("sum 21600 0 @3");
    formulas.addNewF().setEqn("if @0 @3 0");
    formulas.addNewF().setEqn("if @0 21600 @1");
    formulas.addNewF().setEqn("if @0 0 @2");
    formulas.addNewF().setEqn("if @0 @4 21600");
    formulas.addNewF().setEqn("mid @5 @6");
    formulas.addNewF().setEqn("mid @8 @5");
    formulas.addNewF().setEqn("mid @7 @8");
    formulas.addNewF().setEqn("mid @6 @7");
    formulas.addNewF().setEqn("sum @6 0 @5");
    CTPath path = shapetype.addNewPath();
    path.setTextpathok(STTrueFalse.T);
    path.setConnecttype(STConnectType.CUSTOM);
    path.setConnectlocs("@9,0;@10,10800;@11,21600;@12,10800");
    path.setConnectangles("270,180,90,0");
    CTTextPath shapeTypeTextPath = shapetype.addNewTextpath();
    shapeTypeTextPath.setOn(STTrueFalse.T);
    shapeTypeTextPath.setFitshape(STTrueFalse.T);
    CTHandles handles = shapetype.addNewHandles();
    CTH h = handles.addNewH();
    h.setPosition("#0,bottomRight");
    h.setXrange("6629,14971");
    CTLock lock = shapetype.addNewLock();
    lock.setExt(STExt.EDIT);
    CTShape shape = group.addNewShape();
    shape.setId("PowerPlusWaterMarkObject" + idx);
    shape.setSpid("_x0000_s102" + (4+idx));
    shape.setType("#_x0000_t136");
    shape.setStyle("position:absolute;margin-left:0;margin-top:0;width:415pt;height:207.5pt;z-index:-251654144;mso-wrap-edited:f;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin");
    shape.setWrapcoords("616 5068 390 16297 39 16921 -39 17155 7265 17545 7186 17467 -39 17467 18904 17467 10507 17467 8710 17545 18904 17077 18787 16843 18358 16297 18279 12554 19178 12476 20701 11774 20779 11228 21131 10059 21248 8811 21248 7563 20975 6316 20935 5380 19490 5146 14022 5068 2616 5068");
    shape.setFillcolor("black");
    shape.setStroked(STTrueFalse.FALSE);
    CTTextPath shapeTextPath = shape.addNewTextpath();
    shapeTextPath.setStyle("font-family:"Cambria";font-size:1pt");
    shapeTextPath.setString(text);
    pict.set(group);
    // end watermark paragraph
    return new XWPFParagraph(p, null);
  }
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPicture

Copyright © 2018 www.massapicom. 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.