convert_pdftomd
Convert PDF files to Markdown with automatic heading detection, table extraction, and optional watermark removal.
Instructions
Convert a PDF file to Markdown.
Uses PyMuPDF with font-size heading detection, running header/footer
removal, table extraction, and optional watermark stripping — the Assembly
PDF→MD pipeline. Returns the Markdown text; when `output_path` is given it
also writes a `.md` file there.
Args:
pdf_path: Path to the source `.pdf` file.
output_path: Optional path to also write the Markdown to (`.md`).
strip_watermarks: Remove Standards-NZ / IHS style watermark lines and
light-grey overlay text.
front_matter: Prepend YAML front-matter linking back to the source PDF.
Returns:
The converted Markdown as a string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pdf_path | Yes | ||
| output_path | No | ||
| front_matter | No | ||
| strip_watermarks | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |