Skip to content

feat(export): add PDF export for all content types#85

Open
maidou0215 wants to merge 1 commit into
nexu-io:mainfrom
maidou0215:feat/pdf-export
Open

feat(export): add PDF export for all content types#85
maidou0215 wants to merge 1 commit into
nexu-io:mainfrom
maidou0215:feat/pdf-export

Conversation

@maidou0215

@maidou0215 maidou0215 commented May 23, 2026

Copy link
Copy Markdown

Summary

  • Add .pdf export option for all content types (not just Deck), using browser native print
  • Vector-quality A4 output with proper CSS pagination (page-break-inside: avoid for headings/tables/pre`)
  • @page { margin: 0 } + body padding to suppress browser print headers/footers
  • No new dependencies

Validation

  • ./node_modules/.bin/tsc --noEmit
  • bun run build (from next/)
  • Generate any HTML content, click Export → Download → .pdf
  • Verify print dialog opens with A4 layout, no about:blank header
  • Verify multi-page content paginates correctly
  • Verify Deck PDF still works independently

🤖 Generated with Claude Code

Use browser native print to generate vector-quality A4 PDFs with
proper pagination, instead of rasterizing to PNG. No extra dependencies
needed.

- Add exportIframeAsPdf in lib/export/pdf.ts
- Add download-pdf button in export menu
- Add i18n keys (en + zh-CN)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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