Examples of XSLFSlideShow


Examples of org.apache.poi.xslf.XSLFSlideShow

      System.err.println("  HXFPowerPointExtractor <filename.pptx>");
      System.exit(1);
    }
    POIXMLTextExtractor extractor =
      new XSLFPowerPointExtractor(
          new XSLFSlideShow(args[0]));
    System.out.println(extractor.getText());
  }
View Full Code Here

Examples of org.apache.poi.xslf.XSLFSlideShow

        System.getProperty("HSLF.testdata.path") +
        File.separator + "sample.pptx"
    );
    assertTrue(fileA.exists());
   
    xmlA = new XSLFSlideShow(fileA.toString());
  }
View Full Code Here

Examples of org.apache.poi.xslf.XSLFSlideShow

  public void testPowerPoint() throws Exception {
    File f = new File(dirname, "PPTWithAttachments.pptx");
    assertTrue(f.exists());
   
    POIXMLDocument doc = new XSLFSlideShow(Package.open(f.toString()));
    test(doc, 4);
  }
View Full Code Here

Examples of org.apache.poi.xslf.XSLFSlideShow

     */
    @Override
    protected void buildXHTML(XHTMLContentHandler xhtml) throws SAXException,
            XmlException, IOException {
        XMLSlideShow slideShow = (XMLSlideShow) extractor.getDocument();
        XSLFSlideShow rawSlideShow = null;
        try {
           rawSlideShow = slideShow._getXSLFSlideShow(); // TODO Avoid this in future
        } catch(Exception e) {
           throw new IOException(e.getMessage()); // Shouldn't happen
        }

        XSLFSlide[] slides = slideShow.getSlides();
        for (XSLFSlide slide : slides) {
           // Find the ID, until we ditch the raw slideshow
           CTSlideIdListEntry slideId = null;
           for(CTSlideIdListEntry id : rawSlideShow.getSlideReferences().getSldIdList()) {
              if(rawSlideShow.getSlidePart(id).getPartName().equals(slide.getPackagePart().getPartName())) {
                 slideId = id;
              }
           }
           if(slideId == null) {
              // This shouldn't normally happen
              continue;
           }
          
            XSLFSlideMaster master = slide.getMasterSheet();
            CTNotesSlide notes = rawSlideShow.getNotes(slideId);
            CTCommentList comments = rawSlideShow.getSlideComments(slideId);

            // TODO In POI 3.8 beta 5, improve how we get this
            xhtml.startElement("div");
            XSLFCommonSlideData common = new XSLFCommonSlideData(slide.getXmlObject().getCSld());
            extractShapeContent(common, xhtml);
View Full Code Here

Examples of org.apache.poi.xslf.XSLFSlideShow

     */
    @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()) {
          // Add the slide
          PackagePart slidePart;
          try {
             slidePart = document.getSlidePart(ctSlide);
          } catch(IOException e) {
             throw new TikaException("Broken OOXML file", e);
          } catch(XmlException xe) {
             throw new TikaException("Broken OOXML file", xe);
          }
View Full Code Here

Examples of org.apache.poi.xslf.XSLFSlideShow

     * @see org.apache.poi.xslf.extractor.XSLFPowerPointExtractor#getText()
     */
    @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();
View Full Code Here

Examples of org.apache.poi.xslf.XSLFSlideShow

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

Examples of org.apache.poi.xslf.XSLFSlideShow

      System.err.println("  XSLFPowerPointExtractor <filename.pptx>");
      System.exit(1);
    }
    POIXMLTextExtractor extractor =
      new XSLFPowerPointExtractor(
          new XSLFSlideShow(args[0]));
    System.out.println(extractor.getText());
  }
View Full Code Here

Examples of org.apache.poi.xslf.XSLFSlideShow

                HSLFSlideShow slideShow = new HSLFSlideShow(pPart.getInputStream());
            }
            // PowerPoint Document - OpenXML file format
            else if (contentType.equals("application/vnd.openxmlformats-officedocument.presentationml.presentation")) {
                OPCPackage docPackage = OPCPackage.open(pPart.getInputStream());
                XSLFSlideShow slideShow = new XSLFSlideShow(docPackage);
            }
            // Any other type of embedded object.
            else {
                System.out.println("Unknown Embedded Document: " + contentType);
                InputStream inputStream = pPart.getInputStream();
View Full Code Here

Examples of org.apache.poi.xslf.XSLFSlideShow

  }
  public XSLFPowerPointExtractor(XSLFSlideShow slideshow) throws XmlException, IOException {
    this(new XMLSlideShow(slideshow));
  }
  public XSLFPowerPointExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException {
    this(new XSLFSlideShow(container));
  }
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.