io.export

export_pdf / export_image / export_text.

노트

API 시그니처와 docstring 은 Python 소스에서 자동 생성되어 영문으로 표시됩니다.

export.export_pdf

io.export.export_pdf(app, path)

Export the active document to PDF at path.

Thin wrapper around app.save_as(path, format="PDF") that turns raw COM errors into :class:FileIOError.

export.export_image

io.export.export_image(app, path, page=None)

Export the active document (or one page) to an image file.

Parameters

Name Type Description Default
app hwpapi.App required
path str | Path Destination path. Extension suggests the target format — the .png path passes format="PNG" to HWP, everything else falls through to BMP which HWP always supports. required
page int Reserved for future per-page export. Currently HWP’s SaveBlockAction path doesn’t accept a page index, so we log the request and delegate to the whole-document export. None

Raises

Name Type Description
FileIOError On any COM-level failure.

export.export_text

io.export.export_text(app, path)

Export the active document to a plain-text file at path.

Thin wrapper around app.save_as(path, format="TEXT") that turns raw COM errors into :class:FileIOError.

맨 위로