Skip to main content

๐Ÿ“ Word API Reference

This page is currently only available in Chinese. Please switch to ็ฎ€ไฝ“ไธญๆ–‡ for the full content.

๐Ÿ“ Word API Reference

Sub-package: poword | Install: pip install poword Import: import office or import poword

Function Overviewโ€‹

FunctionDescription
docx2pdfWord to PDF (batch supported)
merge4docxMerge multiple Word files
doc2docxDoc to Docx
docx2docDocx to Doc
docx4imgsExtract images from Word

docx2pdfโ€‹

Convert Word documents to PDF. Supports a single file or batch conversion of a whole folder.

office.word.docx2pdf(path, output_path=None)
import office

# Single file
office.word.docx2pdf(
path='document.docx',
output_path='./pdf_output/'
)

# Batch convert
office.word.docx2pdf(
path='./my_documents/',
output_path='./pdf_output/'
)

merge4docxโ€‹

Merge multiple Docx files into one.

office.word.merge4docx(
input_path,
output_path,
new_word_name='merge4docx'
)

doc2docxโ€‹

Doc to Docx.

office.word.doc2docx(
input_path='legacy.doc',
output_path='./output/',
output_name='modern_version'
)

docx2docโ€‹

Docx to Doc.

office.word.docx2doc(
input_path='modern.docx',
output_path='./output/',
output_name='legacy_version'
)

docx4imgsโ€‹

Extract images from a Word document.

office.word.docx4imgs(
word_path='document_with_images.docx',
img_path='./extracted_images/'
)
AI ๅŠžๅ…ฌๆ•ˆ็އ่ฏพ
35 ่ฎฒ AI ่‡ชๅŠจๅŒ–ๅŠžๅ…ฌๅฎžๆˆ˜่ฏพ็”จ Python + AI ๅค„็† Excelใ€Wordใ€PDFใ€้‚ฎไปถ็ญ‰ๅŠžๅ…ฌๅœบๆ™ฏใ€‚
ๅŽปๅญฆไน