Convert document
convert_documentConvert documents between formats (DOCX, PDF, Markdown, ODT, etc.) by providing a source and target format. Verify supported pairs with list_document_conversions first.
Instructions
Converts a document from one supported format to another via documents.js's DocumentConverter port -- docx, pptx, xlsx, odt, odp, ods, odg, odf, markdown, and pdf. Not every (source, targetFormat) pair is supported directly (odf, for instance, only ever converts to pdf); call list_document_conversions first to see which pairs actually are.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fonts | No | Extra font faces to make available to the conversion, for a family the source document does not already embed. Only consulted by a conversion that runs a layout engine (a <format>-to-pdf conversion); every other conversion ignores this option entirely. | |
| output | No | Where to write the converted document. Omit entirely to receive the bytes inline, base64-encoded, instead. | |
| source | Yes | The document to convert. | |
| targetFormat | Yes | The format to convert the document to. Not every (source, targetFormat) pair is supported directly -- call list_document_conversions first to confirm this one is. | |
| onSubstitutionDiagnostics | No | When true, additionally report each individual font-substitution event as structured fontSubstitutions (which family/weight/style was requested, what it resolved to instead, and why). Every substitution is always reported as a plain diagnostic in `diagnostics` regardless of this flag -- this only controls whether the fuller, structured event is also collected. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | Yes | ||
| diagnostics | Yes | ||
| targetFormat | Yes | ||
| fontSubstitutions | No |