# Example Document: System Architecture
This is an example Markdown document that demonstrates the conversion of Markdown with Mermaid diagrams to PDF.
## Project Overview
This document showcases various types of Mermaid diagrams that can be embedded in Markdown and converted to PDF format.
## Flowchart Example
Below is a simple flowchart showing a decision process:
```mermaid
flowchart TD
A[Start] --> B{Is it working?}
B -->|Yes| C[Great!]
B -->|No| D[Debug]
D --> E[Fix Issue]
E --> B
C --> F[End]
```
## Sequence Diagram
Here's a sequence diagram showing the interaction between components:
```mermaid
sequenceDiagram
participant User
participant MCP Server
participant Converter
participant Puppeteer
User->>MCP Server: Request conversion
MCP Server->>Converter: Parse Markdown
Converter->>Converter: Convert to HTML
Converter->>Puppeteer: Launch browser
Puppeteer->>Puppeteer: Render Mermaid
Puppeteer->>Converter: Generate PDF
Converter->>MCP Server: Return result
MCP Server->>User: PDF file path
```
## Class Diagram
This class diagram shows the structure of our system:
```mermaid
classDiagram
class MarkdownMermaidPDFServer {
-Server server
+setupHandlers()
+run()
}
class ConversionOptions {
+string inputPath
+string outputPath
+string customCSS
}
class ConversionResult {
+boolean success
+string outputPath
+string error
}
class Converter {
+convertMarkdownToPDF(options)
-createHTMLDocument(html)
}
MarkdownMermaidPDFServer --> Converter
Converter ..> ConversionOptions
Converter ..> ConversionResult
```
## Gantt Chart
Project timeline:
```mermaid
gantt
title MCP Server Development Timeline
dateFormat YYYY-MM-DD
section Planning
Research :2024-01-01, 3d
Design :2024-01-04, 2d
section Implementation
Core Features :2024-01-06, 5d
Testing :2024-01-11, 3d
section Deployment
Documentation :2024-01-14, 2d
Release :2024-01-16, 1d
```
## Conclusion
This example demonstrates how Markdown content with various types of Mermaid diagrams can be seamlessly converted to PDF format while maintaining visual quality and layout.
### Key Features
- **Clean Rendering**: All diagrams are rendered as high-quality SVG graphics
- **Professional Styling**: Default CSS provides a clean, readable layout
- **Flexibility**: Support for custom CSS styling
- **Easy Integration**: Simple MCP tool interface
### Code Example
Here's a simple code snippet to show code formatting:
```typescript
import { convertMarkdownToPDF } from './converter.js';
const result = await convertMarkdownToPDF({
inputPath: '/path/to/document.md',
outputPath: '/path/to/output.pdf'
});
console.log(result.success ? 'Done!' : result.error);
```
---
**Generated by Markdown + Mermaid to PDF MCP Server**