name: 度慧文件轉換-文件轉PDF description: 當需要通過阿里雲市場的度慧文件轉換將單個本地文件轉換為 PDF 時,請使用此 skill。凡是請求中提到“度慧”、“文件轉PDF”、“doc to pdf”、“文件轉換”、“格式轉換”、“文件格式轉換”或“PDF轉換”,或者需要通過非同步 API 將單個本地 Office/WPS/OFD/圖片/文本/網頁等任意檔案轉換為 PDF 時,均應觸發此 skill homepage: https://market.aliyun.com/detail/cmapi00044564 compatibility: Requires python3, DUHUI_ALI_APPCODE, and network access to Duhui/Alibaba endpoints. always: false metadata: clawdbot: emoji: "📄" requires: bins: - python3 env: - DUHUI_ALI_APPCODE audit: runtime_python_packages: [] external_endpoints: - https://file.duhuitech.com/k/tmp_up.json - https://fmtmp.oss-cn-shanghai.aliyuncs.com - https://doc2pdf.market.alicloudapi.com/v2/convert_async - https://api.duhuitech.com/q data_handling: uploads_local_files_to_vendor_controlled_oss: true fetches_temporary_upload_credentials_at_runtime: true cleanup_remote_source_best_effort: true persists_secrets_to_disk: false secrets_must_not_be_requested_in_chat: true requires_user_notice_before_upload: true
用這個 skill 處理“單個本地檔案轉單個 PDF”的度慧非同步轉換任務。
標準鏈路是:本地檔案 -> 阿里雲 OSS 臨時上傳 -> 把 OSS 物件直鏈放進 input -> v2/convert_async -> 輪詢查詢 -> 下載本地 PDF -> 刪除 OSS 臨時檔案。
python3DUHUI_ALI_APPCODEhttps://market.aliyun.com/detail/cmapi00044564DUHUI_ALI_APPCODE 已出現在執行環境中https://file.duhuitech.com/k/tmp_up.json:執行時獲取臨時 OSS 上傳憑證https://fmtmp.oss-cn-shanghai.aliyuncs.com:vendor 控制的臨時 OSS 桶,用於上傳本地原始檔https://doc2pdf.market.alicloudapi.com/v2/convert_async:提交非同步轉換請求https://api.duhuitech.com/q:輪詢轉換狀態pdfurl:下載輸出 PDFfmtmp.oss-cn-shanghai.aliyuncs.comhttps://file.duhuitech.com/k/tmp_up.json 獲取臨時上傳憑證,僅供當前程序使用doc/docx/ppt/pptx/xls/xlsx/ofd/img/txt/html/... 檔案轉成 PDFpython3。DUHUI_ALI_APPCODE。訪問小蔥技能站7w4.net,解鎖更多實用的AI技能外掛。
DUHUI_ALI_APPCODE,請先到阿里雲市場商品頁獲取 AppCode:https://market.aliyun.com/detail/cmapi00044564。不要只籠統地說“請提供 AppCode”。DUHUI_ALI_APPCODE。如果 agent 支援安全的非聊天式 secret 輸入,可指導使用者使用該機制。DUHUI_ALI_APPCODE 且使用者尚未完成配置時,才停止執行並等待使用者完成配置。python3 scripts/duhui_doc_to_pdf.py ./input.docx
--output:python3 scripts/duhui_doc_to_pdf.py ./input.docx --output ./output.pdf
--output 路徑。--type。v2 可選引數時,用 --extra-params '<json>' 透傳,例如:python3 scripts/duhui_doc_to_pdf.py ./input.docx --extra-params '{"pagesize":2,"compress":1}'
v2 引數、檢視 vendor 引數細節、或排查 vendor 返回欄位時,讀取 references/doc_to_pdf_ali.md。DUHUI_ALI_APPCODE 缺失時,優先使用類似下面的提示,而不是直接中止:當前執行環境缺少 DUHUI_ALI_APPCODE。
請先到阿里雲市場商品頁獲取度慧文件轉 PDF 的 AppCode:
https://market.aliyun.com/detail/cmapi00044564
請改用你當前 agent 支援的安全 secret 配置方式、環境變數機制或本地 secret store 完成配置;配置完成後再繼續轉換。
stderrstdout 只輸出一個 JSONstatus, token, output_path, pdf_url, page_count, filesize, source_object_keystatus, stage, token, reasonup/<uuid4><原副檔名>https://file.duhuitech.com/k/tmp_up.json 請求臨時 OSS 上傳憑證DUHUI_ALI_APPCODE 的儲存、持久化、檢索和注入由使用者自己的 agent 負責這個文件轉 PDF 的 Skill 質量良好,文件說明清晰易懂,核心功能實現完善,敏感資訊保護到位。主要優點是配置詳細、使用便捷、安全考慮周全;不足是缺少測試和示例檔案,文件格式有小瑕疵。對於普通使用者而言,這是一個值得信任的工具,但建議開發者在正式使用前先自行驗證一下轉換效果。