Duhui Document to PDF
Paste the following prompt into your AI chat to install this skill:
Please install @user_d9c601a2/duhui-all-to-pdf according to https://skillhub.cn/install/skillhub.md.
About this skill
Problem It Solves
This skill handles converting one local file to PDF through Duhui's asynchronous conversion service, including doc/docx, ppt/pptx, xls/xlsx, ofd, images, txt, and html. It is intended for tasks where the workflow requires the vendor API, such as PDF compression or PDF watermarking parameters, rather than local conversion with LibreOffice. It does not support direct URL input, Base64 input, or callback URLs.
How It Works
The runtime requires python3 and the DUHUI_ALI_APPCODE environment variable. The script follows the standard path: upload the local file to a temporary Shanghai OSS bucket, pass the OSS object URL to v2/convert_async, poll the status every 2 seconds for up to 60 minutes, download the resulting PDF, and delete the temporary remote file on a best-effort basis. Progress is written to stderr, while stdout emits a single JSON object; success includes output_path, pdf_url, page_count, and filesize.
Boundaries and Notes
- The default behavior overwrites an existing PDF with the same name; use
--outputto keep the old result. - Use
--typeonly when the file extension is missing, incorrect, or the source type must be forced. - Use
--extra-params ''to pass optional vendor v2 parameters; checkreferences/doc_to_pdf_ali.mdfor supported formats and field details. - Do not echo the AppCode or OSS credentials in chat, logs, or final output; a failed remote deletion only records a warning and may leave the source file temporarily.
Use Cases
- Convert a single local Word contract file to PDF for delivery or archiving.
- Turn a local Excel report into a PDF and write it to a specified output path.
- Use Duhui's async API to convert one local OFD or HTML file into PDF.
- Pass optional v2 parameters to add PDF watermarking or compression requirements.
Best For
- Support engineers who ask an agent to convert one local Office file to PDF.
- Automation developers who want to avoid hand-writing OSS upload and polling logic.
- Document-processing engineers who need v2 parameters for PDF watermarking or compression.
- Platform engineers maintaining Agent Skills workflows with clear I/O contracts.
Related Skills
Generate and edit .pptx decks with python-pptx, applying structured layouts, design rules, native charts, and visual QA to reduce template-like output.
Tencent Cloud Table Recognition V3 is an OCR skill for detecting and recognizing tables in images or PDFs, supporting various table types like linear and borderless tables, with Excel export.
The complete set of online document operation tools provided by Tencent Docs MCP, supporting creation, querying, and editing of smart docs, Excel, PPT, mind maps, and more.
Turn a topic, notes, or tables into a complete PPT plan with logic, page layouts, visual and chart guidance, and natural defense scripts.