Java PowerPoint에서 텍스트 가져오기
아래 준비
1.E-iceblue 공식 사이트에서 Free Spire. Presentation for Java 무료 버전을 다운로드합니다.


원본 파일

import com.spire.presentation.*;
import java.io.FileWriter;
public class ExtractText {
public static void main(String[] args) throws Exception {
//Presentation objectを作成します。
Presentation ppt = new Presentation();
//PowerPointファイルをロードしmなす。
ppt.loadFromFile("Input.pptx");
StringBuilder buffer = new StringBuilder();
//スライドをループして、テキストを取得します。
for (Object slide : ppt.getSlides()) {
for (Object shape : ((ISlide) slide).getShapes()) {
if (shape instanceof IAutoShape) {
for (Object tp : ((IAutoShape) shape).getTextFrame().getParagraphs()) {
buffer.append(((ParagraphEx) tp).getText());
}
}
}
}
//保存します。
FileWriter writer = new FileWriter("ExtractText.txt");
writer.write(buffer.toString());
writer.flush();
writer.close();
}
}
실행 결과

Reference
이 문제에 관하여(Java PowerPoint에서 텍스트 가져오기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/iceblue/items/ef31759194feca0798f9텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)