convert_mdtopdf
Generate a PDF from Markdown by passing a file path or raw text. Outputs a print-ready PDF to a specified path.
Instructions
Convert Markdown to a PDF file.
Renders Markdown → HTML → PDF with WeasyPrint (the Assembly MD→PDF stack)
using a clean print stylesheet. Provide EITHER `md_path` OR `markdown_text`.
A PDF is binary, so `output_path` is required.
Args:
output_path: Path to write the resulting `.pdf` (required).
md_path: Path to a source `.md` file.
markdown_text: Raw Markdown string (alternative to `md_path`).
title: Optional document title (falls back to front-matter `title`).
css: Optional CSS to replace the built-in print stylesheet.
Returns:
A confirmation string with the output path, byte size, and page count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | ||
| title | No | ||
| md_path | No | ||
| output_path | Yes | ||
| markdown_text | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |