Package org.apache.poi

Examples of org.apache.poi.POIXMLTextExtractor


  protected String readContent(VFSLeaf leaf) throws IOException, DocumentException {
    BufferedInputStream bis = null;
    StringBuilder buffy = new StringBuilder();
    try {
      bis = new BufferedInputStream(leaf.getInputStream());
      POIXMLTextExtractor extractor = (POIXMLTextExtractor) ExtractorFactory.createExtractor(bis);
      POIXMLDocument document = extractor.getDocument();

      if (document instanceof XSSFWorkbook) {
        XSSFWorkbook xDocument = (XSSFWorkbook) document;
        extractContent(buffy, xDocument);
      }
View Full Code Here


  protected String readContent(VFSLeaf leaf) throws IOException, DocumentException {
    BufferedInputStream bis = null;
    StringBuilder buffy = new StringBuilder();
    try {
      bis = new BufferedInputStream(leaf.getInputStream());
      POIXMLTextExtractor extractor = (POIXMLTextExtractor) ExtractorFactory.createExtractor(bis);
      POIXMLDocument document = extractor.getDocument();
     
      if (document instanceof XWPFDocument) {
        XWPFDocument xDocument = (XWPFDocument) document;
        XWPFHeaderFooterPolicy hfPolicy = xDocument.getHeaderFooterPolicy();
        extractHeaders(buffy, hfPolicy);
View Full Code Here

  public String readContent(VFSLeaf leaf) throws IOException, DocumentException {
    BufferedInputStream bis = null;
    StringBuilder buffy = new StringBuilder();
    try {
      bis = new BufferedInputStream(leaf.getInputStream());
      POIXMLTextExtractor extractor = (POIXMLTextExtractor) ExtractorFactory.createExtractor(bis);
      POIXMLDocument document = extractor.getDocument();

      if (document instanceof XSLFSlideShow) {
        XSLFSlideShow slideShow = (XSLFSlideShow) document;
        XMLSlideShow xmlSlideShow = new XMLSlideShow(slideShow);
        extractContent(buffy, xmlSlideShow);
View Full Code Here

    if(args.length < 1) {
      System.err.println("Use:");
      System.err.println("  HXFWordExtractor <filename.docx>");
      System.exit(1);
    }
    POIXMLTextExtractor extractor =
      new XWPFWordExtractor(POIXMLDocument.openPackage(
          args[0]
      ));
    System.out.println(extractor.getText());
  }
View Full Code Here

    if(args.length < 1) {
      System.err.println("Use:");
      System.err.println("  HXFExcelExtractor <filename.xlsx>");
      System.exit(1);
    }
    POIXMLTextExtractor extractor =
      new XSSFExcelExtractor(args[0]);
    System.out.println(extractor.getText());
  }
View Full Code Here

            Metadata metadata, Locale locale)
            throws IOException, SAXException, TikaException {
        try {
            OOXMLExtractor extractor;

            POIXMLTextExtractor poiExtractor =
                (POIXMLTextExtractor) ExtractorFactory.createExtractor(stream);
            POIXMLDocument document = poiExtractor.getDocument();
            if (document instanceof XSLFSlideShow) {
                extractor = new XSLFPowerPointExtractorDecorator(
                        (XSLFPowerPointExtractor) poiExtractor);
            } else if (document instanceof XSSFWorkbook) {
                extractor = new XSSFExcelExtractorDecorator(
View Full Code Here

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

    if(args.length < 1) {
      System.err.println("Use:");
      System.err.println("  HXFWordExtractor <filename.xlsx>");
      System.exit(1);
    }
    POIXMLTextExtractor extractor =
      new HXFWordExtractor(HXFDocument.openPackage(
          new File(args[0])
      ));
    System.out.println(extractor.getText());
  }
View Full Code Here

    if(args.length < 1) {
      System.err.println("Use:");
      System.err.println("  HXFExcelExtractor <filename.xlsx>");
      System.exit(1);
    }
    POIXMLTextExtractor extractor =
      new HXFExcelExtractor(HXFDocument.openPackage(
          new File(args[0])
      ));
    System.out.println(extractor.getText());
  }
View Full Code Here

    if(args.length < 1) {
      System.err.println("Use:");
      System.err.println("  HXFPowerPointExtractor <filename.pptx>");
      System.exit(1);
    }
    POIXMLTextExtractor extractor =
      new HXFPowerPointExtractor(HXFDocument.openPackage(
          new File(args[0])
      ));
    System.out.println(extractor.getText());
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.POIXMLTextExtractor

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.