gpt4 book ai didi

org.apache.poi.xslf.usermodel.XSLFSlideShow.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 03:16:40 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.poi.xslf.usermodel.XSLFSlideShow.<init>()方法的一些代码示例,展示了XSLFSlideShow.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSLFSlideShow.<init>()方法的具体详情如下:
包路径:org.apache.poi.xslf.usermodel.XSLFSlideShow
类名称:XSLFSlideShow
方法名:<init>

XSLFSlideShow.<init>介绍

暂无

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

public XSLFPowerPointExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException {
  this(new XSLFSlideShow(container));
}

代码示例来源:origin: org.apache.poi/poi-ooxml

public static void main(String[] args) throws Exception {
  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();
}

代码示例来源:origin: apache/tika

private static POIXMLTextExtractor tryXSLF(OPCPackage pkg, boolean eventBased) throws XmlException, OpenXML4JException, IOException {
  PackageRelationshipCollection packageRelationshipCollection = pkg.getRelationshipsByType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument");
  if (packageRelationshipCollection.size() == 0) {
    packageRelationshipCollection = pkg.getRelationshipsByType("http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument");
  }
  if (packageRelationshipCollection.size() == 0) {
    return null;
  }
  PackagePart corePart = pkg.getPart(packageRelationshipCollection.getRelationship(0));
  String targetContentType = corePart.getContentType();
  XSLFRelation[] xslfRelations = org.apache.poi.xslf.extractor.XSLFPowerPointExtractor.SUPPORTED_TYPES;
  for (int i = 0; i < xslfRelations.length; i++) {
    XSLFRelation xslfRelation = xslfRelations[i];
    if (xslfRelation.getContentType().equals(targetContentType)) {
      if (eventBased) {
        return new XSLFEventBasedPowerPointExtractor(pkg);
      } else {
        return new XSLFPowerPointExtractor(new XSLFSlideShow(pkg));
      }
    }
  }
  if (XSLFRelation.THEME_MANAGER.getContentType().equals(targetContentType)) {
    if (eventBased) {
      return new XSLFEventBasedPowerPointExtractor(pkg);
    } else {
      return new XSLFPowerPointExtractor(new XSLFSlideShow(pkg));
    }
  }
  return null;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

public XSLFPowerPointExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException {
  this(new XSLFSlideShow(container));
}

代码示例来源:origin: apache/tika

XSLFSlideShow document = null;
try {
  document = new XSLFSlideShow(extractor.getPackage());
} catch (Exception e) {
  throw new TikaException(e.getMessage()); // Shouldn't happen

代码示例来源:origin: stackoverflow.com

System.out.println(new XSLFPowerPointExtractor(
 new XMLSlideShow(new XSLFSlideShow(
 "X:\\Master\\simpl_temp\\2d0a44a2-95e7-428c-911c-1f803acbff42.pptx"))).getText());

代码示例来源:origin: stackoverflow.com

String filePath = "X:\\Master\\simpl_temp\\2d0a44a2-95e7-428c-911c-1f803acbff42.pptx";
System.out.println(new XSLFPowerPointExtractor(new XMLSlideShow(new XSLFSlideShow(filePath))).getText());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

public static void main(String[] args) throws Exception {
  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();
}

代码示例来源:origin: stackoverflow.com

String lowerFilePath = filePath.toLowerCase();
if (lowerFilePath.endsWith(".xls")) {
      HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(lowerFilePath));
      Integer sheetNums = workbook.getNumberOfSheets();
      if (sheetNums > 0) {
        return workbook.getSheetAt(0).getRowBreaks().length + 1;
      }
    } else if (lowerFilePath.endsWith(".xlsx")) {
      XSSFWorkbook xwb = new XSSFWorkbook(lowerFilePath);
      Integer sheetNums = xwb.getNumberOfSheets();
      if (sheetNums > 0) {
        return xwb.getSheetAt(0).getRowBreaks().length + 1;
      }
    } else if (lowerFilePath.endsWith(".docx")) {
      XWPFDocument docx = new XWPFDocument(POIXMLDocument.openPackage(lowerFilePath));
      return docx.getProperties().getExtendedProperties().getUnderlyingProperties().getPages();
    } else if (lowerFilePath.endsWith(".doc")) {
      HWPFDocument wordDoc = new HWPFDocument(new FileInputStream(lowerFilePath));
      return wordDoc.getSummaryInformation().getPageCount();
    } else if (lowerFilePath.endsWith(".ppt")) {
      HSLFSlideShow document = new HSLFSlideShow(new FileInputStream(lowerFilePath));
      SlideShow slideShow = new SlideShow(document);
      return slideShow.getSlides().length;
    } else if (lowerFilePath.endsWith(".pptx")) {
      XSLFSlideShow xdocument = new XSLFSlideShow(lowerFilePath);
      XMLSlideShow xslideShow = new XMLSlideShow(xdocument);
      return xslideShow.getSlides().length;
}

代码示例来源:origin: org.apache.tika/tika-parsers

private static POIXMLTextExtractor tryXSLF(OPCPackage pkg, boolean eventBased) throws XmlException, OpenXML4JException, IOException {
  PackageRelationshipCollection packageRelationshipCollection = pkg.getRelationshipsByType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument");
  if (packageRelationshipCollection.size() == 0) {
    packageRelationshipCollection = pkg.getRelationshipsByType("http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument");
  }
  if (packageRelationshipCollection.size() == 0) {
    return null;
  }
  PackagePart corePart = pkg.getPart(packageRelationshipCollection.getRelationship(0));
  String targetContentType = corePart.getContentType();
  XSLFRelation[] xslfRelations = org.apache.poi.xslf.extractor.XSLFPowerPointExtractor.SUPPORTED_TYPES;
  for (int i = 0; i < xslfRelations.length; i++) {
    XSLFRelation xslfRelation = xslfRelations[i];
    if (xslfRelation.getContentType().equals(targetContentType)) {
      if (eventBased) {
        return new XSLFEventBasedPowerPointExtractor(pkg);
      } else {
        return new XSLFPowerPointExtractor(new XSLFSlideShow(pkg));
      }
    }
  }
  if (XSLFRelation.THEME_MANAGER.getContentType().equals(targetContentType)) {
    if (eventBased) {
      return new XSLFEventBasedPowerPointExtractor(pkg);
    } else {
      return new XSLFPowerPointExtractor(new XSLFSlideShow(pkg));
    }
  }
  return null;
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers

XSLFSlideShow document = null;
try {
  document = new XSLFSlideShow(extractor.getPackage());
} catch (Exception e) {
  throw new TikaException(e.getMessage()); // Shouldn't happen

代码示例来源:origin: org.apache.tika/tika-parsers

XSLFSlideShow document = null;
try {
  document = new XSLFSlideShow(extractor.getPackage());
} catch (Exception e) {
  throw new TikaException(e.getMessage()); // Shouldn't happen

代码示例来源:origin: com.qwazr/qwazr-library-poi

@Override
public void parseContent(final MultivaluedMap<String, String> parameters, final Path filePath,
    final String extension, final String mimeType, final ParserResultBuilder resultBuilder) throws Exception {
  final XSLFSlideShow pptSlideShow = new XSLFSlideShow(filePath.toAbsolutePath().toString());
  final XMLSlideShow slideshow = new XMLSlideShow(pptSlideShow.getPackage());
  final ParserFieldsBuilder metas = resultBuilder.metas();
  metas.set(MIME_TYPE, findMimeType(extension, mimeType, this::findMimeTypeUsingDefault));
  // Extract metadata
  try (XSLFPowerPointExtractor poiExtractor = new XSLFPowerPointExtractor(slideshow)) {
    final CoreProperties info = poiExtractor.getCoreProperties();
    if (info != null) {
      metas.add(TITLE, info.getTitle());
      metas.add(CREATOR, info.getCreator());
      metas.add(SUBJECT, info.getSubject());
      metas.add(DESCRIPTION, info.getDescription());
      metas.add(KEYWORDS, info.getKeywords());
      metas.add(CREATION_DATE, info.getCreated());
      metas.add(MODIFICATION_DATE, info.getModified());
    }
  }
  extractSides(slideshow, resultBuilder);
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com