Examples of XMLSlideShow


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

public class XSLFTestDataSamples {

    public static XMLSlideShow openSampleDocument(String sampleName) {
        InputStream is = POIDataSamples.getSlideShowInstance().openResourceAsStream(sampleName);
        try {
            return new XMLSlideShow(OPCPackage.open(is));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

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

    public static XMLSlideShow writeOutAndReadBack(XMLSlideShow doc) {
        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream(4096);
            doc.write(baos);
            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            return new XMLSlideShow(OPCPackage.open(bais));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

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

  public XSLFPowerPointExtractor(XMLSlideShow slideshow) {
    super(slideshow);
    this.slideshow = slideshow;
  }
  public XSLFPowerPointExtractor(XSLFSlideShow slideshow) throws XmlException, IOException {
    this(new XMLSlideShow(slideshow.getPackage()));
  }
View Full Code Here

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

  public XSLFPowerPointExtractor(XMLSlideShow slideshow) {
    super(slideshow._getXSLFSlideShow());
    this.slideshow = slideshow;
  }
  public XSLFPowerPointExtractor(XSLFSlideShow slideshow) throws XmlException, IOException {
    this(new XMLSlideShow(slideshow));
  }
View Full Code Here

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

    /**
     * @see org.apache.poi.xslf.extractor.XSLFPowerPointExtractor#getText()
     */
    protected void buildXHTML(XHTMLContentHandler xhtml) throws SAXException, IOException {
        XMLSlideShow slideShow = (XMLSlideShow) extractor.getDocument();

        XSLFSlide[] slides = slideShow.getSlides();
        for (XSLFSlide slide : slides) {
            // slide
            extractContent(slide.getShapes(), false, xhtml);

            // slide layout which is the master sheet for this slide
View Full Code Here

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

     *  and slide drawings which have the images
     */
    @Override
    protected List<PackagePart> getMainDocumentParts() throws TikaException {
       List<PackagePart> parts = new ArrayList<PackagePart>();
       XMLSlideShow slideShow = (XMLSlideShow) extractor.getDocument();
       XSLFSlideShow document = null;
       try {
          document = slideShow._getXSLFSlideShow(); // TODO Avoid this in future
       } catch(Exception e) {
          throw new TikaException(e.getMessage()); // Shouldn't happen
       }
      
       for (CTSlideIdListEntry ctSlide : document.getSlideReferences().getSldIdList()) {
View Full Code Here

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

     */
    @Override
    protected void buildXHTML(XHTMLContentHandler xhtml) throws SAXException,
            XmlException, IOException {
        XSLFSlideShow slideShow = (XSLFSlideShow) extractor.getDocument();
        XMLSlideShow xmlSlideShow = new XMLSlideShow(slideShow);

        XSLFSlide[] slides = xmlSlideShow.getSlides();
        for (XSLFSlide slide : slides) {
            CTSlide rawSlide = slide._getCTSlide();
            CTSlideIdListEntry slideId = slide._getCTSlideId();

            CTNotesSlide notes = xmlSlideShow._getXSLFSlideShow().getNotes(
                    slideId);
            CTCommentList comments = xmlSlideShow._getXSLFSlideShow()
                    .getSlideComments(slideId);

            xhtml.startElement("div");
            extractShapeContent(slide.getCommonSlideData(), xhtml);

View Full Code Here

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

public class ApacheOpenandSave
{
  public static void main(String[] args) throws Exception
  {
    XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("data/presentation.pptx"));

      //append a new slide to the end
      XSLFSlide blankSlide = ppt.createSlide();
     
    //save changes in a file
    FileOutputStream out = new FileOutputStream("data/EditedPPT_Apache.pptx");
    ppt.write(out);
    out.close();

    System.out.println("Presentation Edited and Saved.");
  }
View Full Code Here

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

public class ApacheFormatting
{
  public static void main(String[] args) throws Exception
  {
    XMLSlideShow ppt = new XMLSlideShow();
      XSLFSlide slide = ppt.createSlide();

      XSLFTextBox shape = slide.createTextBox();
      XSLFTextParagraph p = shape.addNewTextParagraph();

      XSLFTextRun r1 = p.addNewTextRun();
      r1.setText("The");
      r1.setFontColor(Color.blue);
      r1.setFontSize(24);

      XSLFTextRun r2 = p.addNewTextRun();
      r2.setText(" quick");
      r2.setFontColor(Color.red);
      r2.setBold(true);

      XSLFTextRun r3 = p.addNewTextRun();
      r3.setText(" brown");
      r3.setFontSize(12);
      r3.setItalic(true);
      r3.setStrikethrough(true);
     
      XSLFTextRun r4 = p.addNewTextRun();
      r4.setText(" fox");
      r4.setUnderline(true);

      //save changes in a file
    FileOutputStream out = new FileOutputStream("data/Formatted Text_Apache.pptx");
    ppt.write(out);
    out.close();

    System.out.println("Presentation Formatted and Saved.");
  }
View Full Code Here

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

public class ApacheDeleteSlides
{
  public static void main(String[] args)throws Exception
  {
    XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("data/presentation.pptx"));
   
    ppt.removeSlide(0); // 0-based index of a slide to be removed
   
    FileOutputStream out = new FileOutputStream("data/DeleteSlide_Apache.ppt");
    ppt.write(out);
    out.close();
  }
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.