create_pdf_from_markdown
Convert markdown content to PDF with support for headers, lists, tables, code blocks, images, and Mermaid diagrams. Specify paper format, orientation, border, and optional watermark. Output saved to a defined filename and directory.
Instructions
Convert markdown content to PDF. Supports basic markdown elements like headers, lists, tables, code blocks, blockquotes, images (both local and external URLs), and Mermaid diagrams. Note: Cannot handle LaTeX math equations. Mermaid syntax errors will be displayed directly in the PDF output.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
markdown | Yes | Markdown content to convert to PDF | |
outputFilename | No | Create a filename for the PDF file to be saved (default: "final-output.pdf"). The environmental variable M2P_OUTPUT_DIR sets the output path directory. If directory is not provided, it will default to user's HOME directory. | |
paperBorder | No | Border margin for the PDF (default: 2cm). Use CSS units (cm, mm, in, px) | 20mm |
paperFormat | No | Paper format for the PDF (default: letter) | letter |
paperOrientation | No | Paper orientation for the PDF (default: portrait) | portrait |
watermark | No | Optional watermark text (max 15 characters, uppercase), e.g. "DRAFT", "PRELIMINARY", "CONFIDENTIAL", "FOR REVIEW", etc |