Analizar formatos PPTX en Java
Análisis de documentos PPTX nativos y de alto rendimiento utilizando Aspose.Slides del lado del servidor para las API de Java, sin el uso de ningún software como Microsoft o Adobe PDF.
Cómo analizar archivos PPTX usando Java
Para analizar el archivo PPTX, usaremos
API que es una API de análisis rica en funciones, potente y fácil de usar para la plataforma Java. Puedes descargar su última versión directamente desde
e instálelo dentro de su proyecto basado en Maven agregando las siguientes configuraciones al pom.xml.
Repositorio
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://releases.aspose.com/java/repo/</url>
</repository>
Dependencia
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-slides</artifactId>
<version>version of aspose-slides API</version>
<classifier>jdk17</classifier>
</dependency>
Pasos para analizar archivos PPTX en Java
Se puede realizar un análisis básico de documentos con Aspose.Slides for Java API con solo unas pocas líneas de código.
Cargue el archivo PPTX instanciando la clase de presentación.
Obtenga los primeros marcos de texto de la diapositiva.
Recorra cada porción de párrafo.
Obtenga la salida requerida como texto, fuente, etc.
Requisitos del sistema
Aspose.Slides para Java es compatible con todas las principales plataformas y sistemas operativos. Por favor, asegúrese de que tiene los siguientes requisitos previos.
- Microsoft Windows o un sistema operativo compatible con Java Runtime Environment para aplicaciones JSP/JSF y aplicaciones de escritorio.
- Obtenga la última versión de Aspose.Slides para Java directamente desde Maven .
Analizar archivos PPTX - Java
//Load PPTX file
Presentation pptxPresentation = new Presentation("demo.pptx");
try{
//Get an Array of TextFrameEx objects from the first slide
ITextFrame[] textFramesSlideOne = SlideUtil.getAllTextBoxes(pptxPresentation.getSlides().get_Item(0));
//Loop through the Array of TextFrames
for (int i = 0; i < textFramesSlideOne.length; i++){
//Loop through paragraphs in current TextFrame
for (IParagraph para : textFramesSlideOne[0].getParagraphs()){
//Loop through portions in the current Paragraph
for (IPortion port : para.getPortions()){
//Display text in the current portion
System.out.print(port.getText());
//Display font height of the text
System.out.print(port.getPortionFormat().getFontHeight());
//Display font name of the text
System.out.print(port.getPortionFormat().getLatinFont().getFontName());
}
}
}
} finally {
if (pptxPresentation != null) pptxPresentation.dispose();
}
//Similarly extarcting text from the Whole Presentation
//Use getAllTextFrames(pptxPresentation, true) method and Iterate through Array
Acerca de Aspose.Slides para la API de Java
Aspose.Slides API se puede utilizar para leer, escribir, manipular y convertir documentos de Microsoft PowerPoint a PDF, XPS, HTML, TIFF, ODP y varios otros formatos. Uno puede crear nuevos archivos desde cero y guardarlos en los formatos compatibles relevantes. Aspose.Slides es una API independiente para crear, analizar o manipular presentaciones, diapositivas y elementos y no depende de ningún software como Microsoft u OpenOffice.Online PPTX Parser Live Demos
Extract text and images from PPTX documents right now by visiting our Live Demos website . The live demo has the following benefits
PPTX Qué es PPTX Formato de archivo
Files with PPTX extension are presentation files created with popular Microsoft PowerPoint application. Unlike the previous version of presentation file format PPT which was binary, the PPTX format is based on the Microsoft PowerPoint open XML presentation file format. A presentation file is a collection of slides where each slide can comprise of text, images, formatting, animations, and other media. These slides are presented to audience in the form of slideshows with custom presentation settings.
Leer más