# Java를 통해 PPT 문서에서 텍스트 및 이미지 추출

> JSP/JSF 응용 프로그램 및 데스크탑 응용 프로그램용 Java Runtime Environment의 PPT 파일에서 텍스트와 이미지를 추출하는 Java 샘플 코드입니다.

Source: https://products.aspose.com/slides/ko/java/parser/ppt/
Updated: 2026-08-11



## Java를 사용하여 PPT 파일을 구문 분석하는 방법

 PPT 파일을 구문 분석하기 위해
 [자바용 Aspose.Slides](https://products.aspose.com/slides/ko/java/)
 기능이 풍부하고 강력하며 사용하기 쉬운 Java 플랫폼용 구문 분석 API인 API입니다. 에서 직접 최신 버전을 다운로드할 수 있습니다.
 [메이븐](https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-slides)
 다음 구성을 pom.xml에 추가하여 Maven 기반 프로젝트 내에 설치합니다.

### 저장소

```xml

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://releases.aspose.com/java/repo/</url>
</repository>

```

### 의존

```xml

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-slides</artifactId>
    <version>26.8</version>
    <classifier>jdk16</classifier>
</dependency>
```

## Java에서 PPT 파일을 구문 분석하는 단계

[Aspose.Slides for Java](https://products.aspose.com/slides/ko/java/) API를 사용한 기본 문서 파싱은 몇 줄의 코드로 완료할 수 있습니다.

Presentation 클래스를 시작하여 PPT 파일을 로드합니다.

첫 번째 슬라이드 텍스트 프레임을 가져옵니다.

각 단락 부분을 반복합니다.

텍스트, 글꼴 등과 같은 필요한 출력을 가져옵니다.

## 시스템 요구 사항

 Java용 Aspose.Slides는 모든 주요 플랫폼 및 운영 체제에서 지원합니다. 다음 전제 조건이 있는지 확인하십시오.

- Microsoft Windows 또는 JSP/JSF 애플리케이션 및 데스크탑 애플리케이션용 Java Runtime Environment와 호환되는 OS.
- 최신 버전의 Aspose.Slides for Java를 다음에서 직접 가져옵니다.
 [메이븐](https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-slides) .

### PPT 파일 파싱 - 자바

```cs
//Load PPT file
Presentation pptPresentation = new Presentation("demo.ppt");
try{
    //Get an Array of TextFrameEx objects from the first slide
    ITextFrame[] textFramesSlideOne = SlideUtil.getAllTextBoxes(pptPresentation.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 (pptPresentation != null) pptPresentation.dispose();
}
//Similarly extarcting text from the Whole Presentation
//Use getAllTextFrames(pptPresentation, true) method and Iterate through Array

```

## Java API용 Aspose.Slides 정보

 Aspose.Slides API는 Microsoft PowerPoint 문서를 읽고, 쓰고, 조작하고, PDF, XPS, HTML, TIFF, ODP 및 기타 다양한 형식으로 변환하는 데 사용할 수 있습니다. 처음부터 새 파일을 만들고 지원되는 관련 형식으로 저장할 수 있습니다. Aspose.Slides는 프레젠테이션, 슬라이드 및 요소를 생성, 구문 분석 또는 조작하기 위한 독립 실행형 API이며 Microsoft 또는 OpenOffice와 같은 소프트웨어에 의존하지 않습니다.

A file with PPT extension represents PowerPoint file that consists of a collection of slides for displaying as SlideShow. It specifies the Binary File Format used by Microsoft PowerPoint 97-2003. A PPT file can contain several different types of information such as text, bulleted points, images, multimedia and other embedded OLE objects. Microsoft came up with newer file format for PowerPoint, known as PPTX, from 2007 onwards that is based on Office OpenXML and is different from this binary file format. Several other application programs such as OpenOffice Impress and Apple Keynote can also create PPT files.

## 기타 지원되는 구문 분석 문서

- [ODP](https://products.aspose.com/slides/ko/java/parser/odp/) — OpenDocument 프레젠테이션 형식
- [PPTX](https://products.aspose.com/slides/ko/java/parser/pptx/) — Open XML 프레젠테이션 형식
