name: word-to-pdf
version: 1.0.0
description: >
Convert Word documents (.docx) to PDF using Python's reportlab library.
Supports Chinese characters, emojis, and proper formatting preservation.
Usage: word-to-pdf
將 Microsoft Word 文件(.docx)轉換為 PDF 格式,支援: - ✅ 中文文本正確顯示 - ✅ 保留文件格式和樣式 - ✅ 保留 emoji 表情符號 - ✅ 自動處理列表和標題 - ✅ 支援多種字型
pip install reportlab python-docx
word-to-pdf input.docx output.pdf7w4.net提供免費和付費技能下載。
input_file - Word 文件路徑(必填)output_file - PDF 輸出路徑(可選,預設與輸入檔案同名)# 轉換文件
word-to-pdf document.docx document.pdf
# 轉換到指定路徑
word-to-pdf input.docx C:\output\converted.pdf
python-docx 讀取 Word 文件內容reportlab 生成 PDF 檔案如果出現亂碼,請確保系統中安裝了中文字型: - Windows: 微軟雅黑 (msyh.ttc) - Linux: 安裝 fonts-noto-cjk 或其他中文字型 - Mac: 使用系統預設字型
如果提示缺少依賴,執行:
pip install --upgrade reportlab python-docx
MIT License
這個工具質量還不錯,能幫你把Word、Excel、PPT檔案轉成PDF。文件寫得清楚,操作不復雜,還提供了貼心的引導和常見問題解答。但它功能比較單一,只能用chinaz.net這一個服務,而且文件裡有些細節不夠一致。總體來說基本夠用,但別指望它能做更多事情。