Skip to content

feat(cowriter): export markdown drafts as PDF#601

Closed
KacperKazan wants to merge 1 commit into
HKUDS:mainfrom
KacperKazan:feat/cowriter-pdf-export
Closed

feat(cowriter): export markdown drafts as PDF#601
KacperKazan wants to merge 1 commit into
HKUDS:mainfrom
KacperKazan:feat/cowriter-pdf-export

Conversation

@KacperKazan

Copy link
Copy Markdown

Summary

  • Add a reusable client-side PDF export helper backed by the existing html2canvas + jspdf dependencies.
  • Add an Export PDF toolbar action to Co-Writer next to the existing Markdown export.
  • Render exports with a light, e-ink-friendly A4 layout and preserve the rendered Markdown preview, including KaTeX/math and diagram output when present in the preview.

Notes

  • This initial implementation intentionally avoids a server-side Pandoc dependency, so it works in the existing web app without installing external binaries.
  • The generated PDF is rendered from the preview DOM, which favors visual fidelity for formulas/diagrams over selectable text.

Validation

  • npm run lint -- "app/(workspace)/co-writer/[docId]/page.tsx" "lib/pdf-export.ts" (passes with existing repo warnings)
  • npx tsc --noEmit --pretty false
  • git diff --check
  • Browser smoke test: created a temporary Co-Writer draft with Markdown, math, and Mermaid content; confirmed Export PDF button renders and completes with PDF exported and no console errors.

@KacperKazan KacperKazan closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant