Examples of XSLFTextShape


Examples of org.apache.poi.xslf.usermodel.XSLFTextShape

    private void extractContent(XSLFShape[] shapes, boolean skipPlaceholders, XHTMLContentHandler xhtml, String slideDesc)
            throws SAXException {
        for (XSLFShape sh : shapes) {
            if (sh instanceof XSLFTextShape) {
                XSLFTextShape txt = (XSLFTextShape) sh;
                Placeholder ph = txt.getTextType();
                if (skipPlaceholders && ph != null) {
                    continue;
                }
                xhtml.element("p", txt.getText());
            } else if (sh instanceof XSLFGroupShape){
                // recurse into groups of shapes
                XSLFGroupShape group = (XSLFGroupShape)sh;
                extractContent(group.getShapes(), skipPlaceholders, xhtml, slideDesc);
            } else if (sh instanceof XSLFTable) {
View Full Code Here

Examples of org.apache.poi.xslf.usermodel.XSLFTextShape

        for(XSLFSlide slide : ppt.getSlides()){
            System.out.println("Title: " + slide.getTitle());

            for(XSLFShape shape : slide.getShapes()){
                if(shape instanceof XSLFTextShape) {
                    XSLFTextShape tsh = (XSLFTextShape)shape;
                    for(XSLFTextParagraph p : tsh){
                        System.out.println("Paragraph level: " + p.getLevel());
                        for(XSLFTextRun r : p){
                            System.out.println(r.getText());
                            System.out.println("  bold: " + r.isBold());
View Full Code Here

Examples of org.apache.poi.xslf.usermodel.XSLFTextShape

        XSLFSlideMaster defaultMaster = ppt.getSlideMasters()[0];

        // title slide
        XSLFSlideLayout titleLayout = defaultMaster.getLayout(SlideLayout.TITLE);
        XSLFSlide slide1 = ppt.createSlide(titleLayout);
        XSLFTextShape title1 = slide1.getPlaceholder(0);
        title1.setText("First Title");

        // title and content
        XSLFSlideLayout titleBodyLayout = defaultMaster.getLayout(SlideLayout.TITLE_AND_CONTENT);
        XSLFSlide slide2 = ppt.createSlide(titleBodyLayout);

        XSLFTextShape title2 = slide2.getPlaceholder(0);
        title2.setText("Second Title");

        XSLFTextShape body2 = slide2.getPlaceholder(1);
        body2.clearText(); // unset any existing text
        body2.addNewTextParagraph().addNewTextRun().setText("First paragraph");
        body2.addNewTextParagraph().addNewTextRun().setText("Second paragraph");
        body2.addNewTextParagraph().addNewTextRun().setText("Third paragraph");



        FileOutputStream out = new FileOutputStream("step2.pptx");
        ppt.write(out);
View Full Code Here

Examples of org.apache.poi.xslf.usermodel.XSLFTextShape

    private void extractContent(XSLFShape[] shapes, boolean skipPlaceholders, XHTMLContentHandler xhtml)
            throws SAXException {
        for (XSLFShape sh : shapes) {
            if (sh instanceof XSLFTextShape) {
                XSLFTextShape txt = (XSLFTextShape) sh;
                Placeholder ph = txt.getTextType();
                if (skipPlaceholders && ph != null) {
                    continue;
                }
                xhtml.element("p", txt.getText());
            } else if (sh instanceof XSLFGroupShape){
                // recurse into groups of shapes
                XSLFGroupShape group = (XSLFGroupShape)sh;
                extractContent(group.getShapes(), skipPlaceholders, xhtml);
            } else if (sh instanceof XSLFTable) {
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.