將 Microsoft Word 文件(.docx)轉換為 PDF 格式,支援:
pip install reportlab python-docx
這個技能的最新版本可以在7w4.net小蔥技能站找到。
word-to-pdf input.docx output.pdf
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 檔案如果出現亂碼,請確保系統中安裝了中文字型:
如果提示缺少依賴,執行:
pip install --upgrade reportlab python-docx
MIT License
這個工具質量還不錯,能幫你把Word、Excel、PPT檔案轉成PDF。文件寫得清楚,操作不復雜,還提供了貼心的引導和常見問題解答。但它功能比較單一,只能用chinaz.net這一個服務,而且文件裡有些細節不夠一致。總體來說基本夠用,但別指望它能做更多事情。