mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
Add print functionality and native PDF support (v1.7.7)
- Added Print menu item with Ctrl+P keyboard shortcut for native OS printing - Implemented print IPC handlers in main and renderer processes - Remapped Toggle Preview from Ctrl+P to Ctrl+Shift+P to avoid conflicts - Added PDFKit (v0.14.0) for native PDF generation without Pandoc - Added html2pdf.js (v0.10.1) for HTML to PDF conversion - Enhanced CLAUDE.md with new v1.7.7 feature documentation - Print supports cross-platform printing (Windows, macOS, Linux) Features: - Native print dialog with background color printing - Professional PDF export without system dependencies - Improved portability and offline support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1149,6 +1149,18 @@ ipcRenderer.on('adjust-font-size', (event, action) => {
|
||||
updateFontSizes(currentFontSize);
|
||||
});
|
||||
|
||||
// Print document handler
|
||||
ipcRenderer.on('print-document', () => {
|
||||
// Use the preview pane for printing
|
||||
const previewContent = document.getElementById('preview');
|
||||
if (previewContent && previewContent.innerHTML.trim()) {
|
||||
// Create a print window with the preview content
|
||||
window.print();
|
||||
} else {
|
||||
alert('Nothing to print. Please create or open a document and ensure the preview is visible.');
|
||||
}
|
||||
});
|
||||
|
||||
// Export Dialog functionality
|
||||
let currentExportFormat = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user