Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# PowerPoint2Image
Apache-POI를 사용해 슬라이드를 이미지로 변환합니다.<br/>
Apache-POI의 문제인지 알 수 없으나, 텍스트 박스의 위치가 약간씩 조정될 수 있습니다.
LibreOffice(soffice)로 슬라이드를 PDF로 변환한 뒤, PDFBox로 각 페이지를 이미지로 렌더링합니다.<br/>
(이전 버전은 Apache POI 자체 렌더러를 사용했는데, 폰트 대체·그룹 도형 좌표 계산에서 오차가
누적되어 도형/이미지/화살표 위치가 조금씩 틀어지는 문제가 있었습니다. LibreOffice는 실제
PowerPoint와 호환되는 레이아웃 엔진이라 좌표가 훨씬 정확합니다.)

## 사전 준비
변환이 실행되는 PC/서버에 **LibreOffice가 설치되어 있어야 합니다.**
soffice 실행 파일 경로는 아래 우선순위로 찾습니다.
1. System Property `-Dsoffice.path=...`
2. 환경변수 `SOFFICE_PATH`
3. OS별 기본 설치 경로 (Windows: `C:\Program Files\LibreOffice\program\soffice.exe`, macOS: `/Applications/LibreOffice.app/Contents/MacOS/soffice`, Linux: `/usr/bin/soffice` 등)
4. 위에서 못 찾으면 PATH에 등록된 `soffice`를 그대로 사용합니다.

기본 경로와 다른 곳에 설치했다면 `new Converter(destDir, "실제 soffice 경로")` 생성자를 사용하세요.

## 사용 방법
### maven dependency에 PowerPoint2Image-1.0.0.jar 파일을 추가할 경우
Expand Down
26 changes: 8 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,15 @@
</plugins>
</build>
<dependencies>
<!--
슬라이드 렌더링은 LibreOffice(soffice, 외부 프로세스)가 PDF로 변환하고,
그 PDF를 PDFBox로 이미지화한다. Apache POI는 더 이상 렌더링에 쓰이지 않는다
(POI 자체 렌더러의 폰트/그룹 도형 좌표 오차 때문에 이 방식으로 교체함).
-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>4.0.1</version>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.29</version>
</dependency>
</dependencies>
<url>https://github.com/seccoding/PowerPoint2Image</url>
Expand Down
Loading