convert_docx_to_pdf
Convert .docx files to high-fidelity PDF without Word or WPS, with optional PNG page previews and automatic engine fallback.
Instructions
Convert a .docx file to high-fidelity PDF and optionally render PNG previews.
Uses the Rust+Skia dxpdf engine by default without requiring Microsoft
Word or WPS Office, with automatic LibreOffice headless fallback when
engine="auto".
Args:
docx_path: Path to the input .docx file.
pdf_path: Destination path for the output .pdf file.
engine: Conversion engine: auto, dxpdf, or libreoffice
(default: auto).
preview_dir: Optional directory path to render each PDF page as a PNG
for visual verification.
dpi: Resolution in DPI for rendered preview PNGs (default: 150).
Returns:
Formatted JSON string containing conversion metadata and optional
preview_pages paths.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"docx_path": "<docx_path>",
"pdf_path": "<pdf_path>"
},
"name": "convert_docx_to_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | ||
| engine | No | auto | |
| pdf_path | Yes | ||
| docx_path | Yes | ||
| preview_dir | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |