Convert Format
AI-generatedOverview
This node operation converts a diagram file from one format to another using the Mermaid CLI. It takes an input file path of a diagram, converts it to the specified output format (PNG, PDF, or SVG), and saves the converted file to the given output path. This is useful for users who need to transform Mermaid diagram files into different visual formats for presentations, reports, or web use.
Use Case Examples
- Convert an SVG diagram file to PNG format for embedding in a presentation.
- Convert a Mermaid diagram file to PDF for printing or sharing.
- Convert a diagram file to SVG format for further editing or web display.
Properties
| Name | Meaning |
|---|---|
| Input File Path | Path to the input diagram file to be converted. |
| Output Format | The desired output format for the converted diagram file (PNG, PDF, or SVG). |
| Output Path | File path where the converted diagram file will be saved. |
Output
JSON
success- Indicates if the conversion was successful.inputPath- The original input file path of the diagram.outputPath- The file path where the converted diagram was saved.format- The output format of the converted diagram file.
Dependencies
- Mermaid CLI executable
Troubleshooting
- Ensure the input file path is correct and the file exists to avoid file not found errors.
- Verify the output path is writable and the directory exists to prevent write errors.
- Check that the Mermaid CLI is installed and accessible in the environment, as the node relies on it for conversion.
- Common error: 'Mermaid CLI execution failed' indicates issues with the CLI command or environment setup; verify CLI installation and parameters.