Skip to content

feat: add PDF export for memos using browser print API#5460

Open
Faizaanp wants to merge 2 commits intousememos:mainfrom
Faizaanp:feature/export-memo-pdf
Open

feat: add PDF export for memos using browser print API#5460
Faizaanp wants to merge 2 commits intousememos:mainfrom
Faizaanp:feature/export-memo-pdf

Conversation

@Faizaanp
Copy link
Contributor

@Faizaanp Faizaanp commented Jan 8, 2026

Add PDF Export for Memos

Fixes #5449

Overview

Implements a PDF export feature for individual memos using the browser's native print API. This approach provides zero-bundle-size increase, perfect rendering fidelity, and native browser print/save-as-PDF functionality.

Changes Made

Frontend Components

  • MemoActionMenu: Added "Export as PDF" menu item in the Copy submenu with FileDownIcon
  • MemoActionMenu hooks: Added handleExportAsPDF callback with error handling
  • MemoView: Added data-memo-name attribute for DOM targeting

Core Functionality

  • web/src/utils/print.ts: New utility that:
    • Opens a new window with the memo content
    • Applies print-specific styles
    • Triggers the browser print dialog
    • Automatically closes after print/cancel/save

Technical Details

Implementation Approach:

  • Uses browser-native window.print() API
  • No external dependencies (no jsPDF, no html2canvas)
  • Respects browser's native print dialog and PDF settings
  • Memo content cloned into new window for isolated printing

###screenshots
image
image

@Faizaanp Faizaanp requested a review from johnnyjoygh as a code owner January 8, 2026 17:31
@boojack boojack force-pushed the main branch 2 times, most recently from a196c72 to 71e8a06 Compare February 10, 2026 01:15
@boojack boojack self-requested a review as a code owner February 24, 2026 14:23
@boojack boojack force-pushed the main branch 2 times, most recently from 2b6b987 to 47d9414 Compare February 24, 2026 14:55
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.

Feature request: Export memo to PDF

1 participant