# Feature: PDF Download Button in Files Dashboard

## Overview
Add a **"Download as PDF"** button in the file preview panel of the files dashboard, next to the existing preview button.

## Requirements

### Functionality
- When user clicks "Download PDF" on any markdown file, convert it to PDF and trigger download
- Button visible in: `/echo/files.html` preview panel
- Works for: `.md` files (markdown)
- Optional: Support other formats (txt, html) if time permits

### UX
- Button placement: Next to "Preview" button in preview panel
- Button label: "📥 Download PDF" or "⬇️ PDF"
- Action: Click → PDF downloads to user's default Downloads folder
- Filename: Use original filename with `.pdf` extension

### Technical Requirements

#### Questions to Answer First:
1. **Where is files.html code?**
   - Location of dashboard files app source
   - Frontend framework (React, Vue, vanilla JS?)
   - How preview panel is structured

2. **PDF Conversion Options:**
   - Install `pandoc` + markdown-to-pdf pipeline?
   - Use server-side converter (Python: `markdown2`, `weasyprint`, `reportlab`)?
   - Use client-side JS library (`html2pdf.js`, `pdfkit`)?
   - Recommendation: **Pandoc** (robust, handles markdown edge cases well)

3. **Architecture:**
   - Backend endpoint needed? (`/api/convert-to-pdf`)
   - Or handle conversion in Python tooling?
   - Where do temporary PDFs live before download?

#### Implementation Path:
1. Locate files app source code
2. Add button HTML/UI element
3. Wire click handler
4. Choose converter (recommend: Pandoc + Python backend)
5. Test with group sprijin files

## Priority
- 🟡 Medium (nice-to-have, improves UX but not blocking)
- Context: User wants to share + print group activity sheets in PDF format

## Related Files
- Dashboard location: `https://moltbot.tailf7372d.ts.net/echo/files.html`
- Files repo: `/home/moltbot/clawd/memory/kb/projects/grup-sprijin/biblioteca/`
- First test case: `fisa-2026-02-05-ancorare-oglinda.md`

---

## Acceptance Criteria
- [ ] User can click "Download PDF" on any .md file
- [ ] PDF downloads with correct filename
- [ ] PDF preserves markdown formatting (headers, lists, emphasis)
- [ ] Works in Firefox/Chrome

## Notes
- User is comfortable with multi-session handoff (can track progress across sub-agents)
