---
title: pdf2html
app_file: web_interface.py
sdk: gradio
sdk_version: 5.20.1
---
# pdf2html
PDF 파일을 단일 컬럼 HTML로 변환하는 Python 패키지입니다.
## 설치
```bash
# Poetry를 사용하는 경우
poetry install
# 또는 pip 사용
pip install pdf2html
```
## 필요 라이브러리
```bash
pip install PyMuPDF beautifulsoup4 langchain gradio gradio-pdf
```
## 사용법
### 명령줄 인터페이스
```bash
# 직접 실행
poerty run python -m pdf2html 경로/파일명.pdf
poerty run python -m pdf2html 경로/파일명.pdf --output 출력디렉토리
# 설치 후 실행
pdf2html 경로/파일명.pdf
pdf2html 경로/파일명.pdf --output 출력디렉토리
```
### 웹 인터페이스
```bash
# 직접 실행
poetry run python -m web_interface
# 설치 후 실행
pdf2html-web
```
### Python 코드에서 사용
```python
from pdf2html import PDFToHTMLConverter
converter = PDFToHTMLConverter("경로/파일명.pdf")
output_path = converter.convert()
print(f"변환 완료: {output_path}")
```
## 주요 기능
- PDF 문서의 텍스트, 이미지, 표 추출
- 1단 세로 레이아웃으로 재구성
- 문단 구조 및 서식 유지
- 이미지 자동 추출 및 포함
- 표 구조 감지 및 HTML 테이블로 변환
- Gradio 기반 웹 인터페이스 제공