convert_document
Convert documents between PDF, DOCX, and Markdown formats. Specify input path and output format to save the converted file.
Instructions
Convert a document between different formats
Args: input_path (str): Absolute path to the input document output_format (OutputFormat): Target format to convert to. One of: "pdf", "docx" or "md"
Returns: str: A message indicating success or failure of the conversion
Notes: This tool is especially useful as a conversion step to make PDF and DOCX files readable in plain text format by converting them to Markdown. This enables easier processing, analysis and interaction with the content of these document formats.
For conversions to PDF or DOCX, the file is saved in the same directory as the input file,
with the same filename but with the extension changed to match the ouput format.
For conversions to Markdown, the markdown file and any images extracted are placed in a folder
that has the same name as the original file (without extension). The markdown file itself
will have the same name as the original file but with the .md extension.
For example:
- Converting /path/to/document.pdf to docx will save as /path/to/document.docx
- Converting /path/to/document.pdf to md will create a folder /path/to/document/
containing document.md and any extracted images
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_path | Yes | ||
| output_format | Yes |