Skip to main content

한컴오피스 설치 유무에 따라 HWP(X) 파일을 PDF로 변환하는 라이브러리

Project description

simple-hwp2pdf

PyPI version License: MIT

한컴오피스 설치 유무에 따라 HWP(.hwp, .hwpx) 파일을 PDF로 변환하는 파이썬 라이브러리입니다.

✨ 주요 특징

  • 듀얼 엔진 지원: 한컴오피스를 이용하는 Office 엔진과, 설치가 필요 없는 Standalone 엔진을 모두 지원합니다.
  • 자동 모드: 파일 확장자에 따라 최적의 엔진을 자동으로 선택합니다.
  • 선택적 설치: 필요한 기능에 따라 라이브러리를 설치할 수 있습니다.

⚙️ 엔진 별 특징

엔진 종류 필요 조건 장점 단점
Standalone (없음) 한컴오피스 불필요, 모든 OS 지원 .hwpx만 완벽 지원, 레이아웃 깨질 수 있음
Office Windows + 한컴오피스 완벽한 레이아웃 보장, .hwp 지원 Windows 환경 및 한컴오피스 설치 필수

📦 설치

기본 설치 (Standalone 엔진만 사용)

pip install simple-hwp2pdf

전체 설치(Office 엔진 포함)

  • Office 엔진을 사용하려면 [office]옵션을 추가하여 설치하세요
pip install simple-hwp2pdf[office]

🚀 사용법

  • 메인 convert 함수를 사용하여 변환을 수행할 수 있습니다. method 파라미터를 통해 사용할 엔진을 지정할 수 있습니다.
    • method='auto' (기본값): .hwpx는 Standalone, .hwp는 Office 엔진을 시도합니다.
    • method='standalone': 한컴오피스 없이 변환합니다.
    • method='office': 한컴오피스를 이용해 변환합니다.
from simple_hwp2pdf import convert
# 1. Auto 모드 사용 (가장 간편한 방법)
# sample.hwpx -> standalone 엔진 사용
# report.hwp -> office 엔진 사용
convert("sample.hwpx", "sample_auto.pdf", method='auto')
convert("report.hwp", "report_auto.pdf") # method 기본값이 'auto'

# 2. Standalone 엔진 사용
# 한컴오피스 없이 변환 (hwpx 파일 권장)
convert("another.hwpx", "another_standalone.pdf", method='standalone')

# 3. Office 엔진 사용
# Windows + 한컴오피스 환경에서 완벽한 변환이 필요할 때
convert("final.hwp", "final_office.pdf", method='office')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_hwp2pdf-1.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_hwp2pdf-1.0.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file simple_hwp2pdf-1.0.2.tar.gz.

File metadata

  • Download URL: simple_hwp2pdf-1.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for simple_hwp2pdf-1.0.2.tar.gz
Algorithm Hash digest
SHA256 038f62d8cb2a13eadf2ddaf24eba3d19ca1d99c8a7a7a2888a73f53d0e11c40c
MD5 7f51c2b3ba55b472f58df9fa0229de3e
BLAKE2b-256 cb856f42c005815e3cd9746656214d57faea00188388a31ad88c7397d2935424

See more details on using hashes here.

File details

Details for the file simple_hwp2pdf-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: simple_hwp2pdf-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for simple_hwp2pdf-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 705f2b4b81c9c4206c8eaf32228333062577181e0b7256d9b1bf8c264b4ea9d1
MD5 a92c12c1c9f4b6bfd71e3924bd935fb8
BLAKE2b-256 1126e03daea223b92ba4457ad3c31c733e240c00476e5f057434982bb3fbe525

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page