Agent skill
markdown-to-pdf
Convert markdown documents to professional PDF files for reports, analysis summaries, and documentation sharing
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/markdown-to-pdf-apexdesigner-base-library
SKILL.md
Markdown to PDF
Convert markdown files to professionally styled PDF documents suitable for reports, financial summaries, presentations, and documentation for sharing.
When to Use This Skill
- User wants to create a PDF version of a markdown document
- User asks to "export to PDF" or "generate a PDF"
- User wants to share analysis or reports in PDF format
- User needs a printable version of documentation
Dependencies
Ensure pdfmake and marked are installed in the project:
npm list pdfmake marked || npm install pdfmake marked
Usage
Basic Conversion
# Convert with default output (same directory, .pdf extension)
node .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.cjs <input.md>
# Specify output location
node .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.cjs <input.md> <output.pdf>
Examples
# Basic conversion
node .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.cjs docs/report.md
# Custom output path
node .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.cjs docs/report.md output/report.pdf
# Show help
node .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.cjs --help
Supported Features
- Headings (h1-h4 with underlines for h1/h2)
- Bold, italic, inline code
- Links (clickable in PDF)
- Ordered and unordered lists (nested)
- Code blocks
- Blockquotes
- Tables
- Horizontal rules
PDF Styling
The tool applies professional styling automatically:
- Clean, readable Helvetica fonts
- Styled tables with header backgrounds
- Proper heading hierarchy with visual separation
- Code blocks with monospace font
- Blockquote styling with left border
- 1-inch page margins suitable for printing
Programmatic Usage
The tool can also be imported as a module:
const { convertMarkdownToPdf, convertMarkdownStringToPdf } = require('./.claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.cjs');
// Convert a file
await convertMarkdownToPdf('input.md', 'output.pdf');
// Convert markdown string content
await convertMarkdownStringToPdf('# My Report\n\nContent here...', 'output.pdf');
Error Handling
Common issues:
- File not found - Verify the input path exists
- Permission denied - Check write permissions on output directory
- Dependencies missing - Run
npm install pdfmake marked
Output Location
By default, PDFs are created in the same directory as the source markdown file with a .pdf extension.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?