[PR #652] [MERGED] Add export note to PDF (#243) #826

Closed
opened 2026-03-03 00:23:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BoostIO/BoostNote-App/pull/652
Author: @Komediruzecki
Created: 10/24/2020
Status: Merged
Merged: 11/21/2020
Merged by: @Rokt33r

Base: masterHead: feature/add-export-note-to-pdf


📝 Commits (5)

📊 Changes

6 files changed (+358 additions, -36 deletions)

View changed files

📝 package-lock.json (+5 -0)
📝 package.json (+2 -1)
📝 src/components/organisms/NotePageToolbar.tsx (+36 -11)
📝 src/electron/index.ts (+6 -0)
📝 src/lib/exports.ts (+218 -24)
src/lib/styled/styleUtil.ts (+91 -0)

📄 Description

Add export note to PDF (3e6abd4f643c3fbecd1f9d74cbda0b267db1b608)
Add export note markdown to PDF in note detail
Add render_md_to_pdf.html file for rendering markdown to HTML first
Add logic for printing to PDF via webContents.printToPdf
Refactor note title sanitization to shared function
Add support for global css style in exports.ts
Add support for wrapping long lines when exporting pre and code through markdown and codemirror sections

Refactor export note to PDF (9f80d9a80178766ba2fb5d9c81602dcd85724dd3)
Refactor code to not use any static HTML file (and thus no javascript, safer for XSS)
Refactor code to be more readable
Reorder menu items for md, html and pdf
Refactor includeFrontMatter fetching
Add support for mathml rendering in PDF export (fix escapes)
Add support for proper header and footer in PDF

  • Include front matter option in Markdown - Export section to get header and footer

Test:
In electron Linux App
In electron Linux App production version (appImage)

Todo:

  • Refactor paths from "node_modules" to actual paths in production
  • See how to test this better for all app versions (Linux, Windows, Web, Mac, Mobile)
  • See if we can remove dependency to previewStyle (removing first N lines etc)
  • See if we can add nicer menu item icons (instead of text) for exporting
  • See if we can add some PDF export options (pageSize: A3, A4, landscape: mode, ...)

IssueHunt Summary

Referenced issues

This pull request has been submitted to:



🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BoostIO/BoostNote-App/pull/652 **Author:** [@Komediruzecki](https://github.com/Komediruzecki) **Created:** 10/24/2020 **Status:** ✅ Merged **Merged:** 11/21/2020 **Merged by:** [@Rokt33r](https://github.com/Rokt33r) **Base:** `master` ← **Head:** `feature/add-export-note-to-pdf` --- ### 📝 Commits (5) - [`71719c9`](https://github.com/BoostIO/BoostNote-App/commit/71719c9c70319e7e0e3f9c76c5edfad30d0f5484) Add export note to PDF (#243) - [`d2a1d01`](https://github.com/BoostIO/BoostNote-App/commit/d2a1d01c7c9edd1681927ddcf05e92d4f1d40016) Refactor export note to PDF - [`d4c6cb8`](https://github.com/BoostIO/BoostNote-App/commit/d4c6cb806f7a0fce94c9ec76b08b88c74bb1c96c) Rename sanitizeNoteName to filenamifyNoteTitle - [`28e7158`](https://github.com/BoostIO/BoostNote-App/commit/28e7158736d2a27d4029a58b875741f424757d7c) Fix markdown exporting - [`3a7c833`](https://github.com/BoostIO/BoostNote-App/commit/3a7c833ab3b343ca4da5448c02b353769bc46f6f) Change export icon ### 📊 Changes **6 files changed** (+358 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+5 -0) 📝 `package.json` (+2 -1) 📝 `src/components/organisms/NotePageToolbar.tsx` (+36 -11) 📝 `src/electron/index.ts` (+6 -0) 📝 `src/lib/exports.ts` (+218 -24) ➕ `src/lib/styled/styleUtil.ts` (+91 -0) </details> ### 📄 Description **Add export note to PDF** (3e6abd4f643c3fbecd1f9d74cbda0b267db1b608) Add export note markdown to PDF in note detail Add render_md_to_pdf.html file for rendering markdown to HTML first Add logic for printing to PDF via webContents.printToPdf Refactor note title sanitization to shared function Add support for global css style in exports.ts Add support for wrapping long lines when exporting pre and code through markdown and codemirror sections **Refactor export note to PDF** (9f80d9a80178766ba2fb5d9c81602dcd85724dd3) Refactor code to not use any static HTML file (and thus no javascript, safer for XSS) Refactor code to be more readable Reorder menu items for md, html and pdf Refactor includeFrontMatter fetching Add support for mathml rendering in PDF export (fix escapes) Add support for proper header and footer in PDF - Include front matter option in Markdown - Export section to get header and footer **Test:** In electron Linux App In electron Linux App production version (appImage) - Example Markdown files: - [markdown-functionality-test.txt](https://github.com/BoostIO/BoostNote.next/files/5519574/markdown-functionality-test.txt) - [math-rendering.txt](https://github.com/BoostIO/BoostNote.next/files/5519575/math-rendering.txt) - PDF Renderings: - [markdown-functionality-test.pdf](https://github.com/BoostIO/BoostNote.next/files/5519605/markdown-functionality-test.pdf) - [math-test.pdf](https://github.com/BoostIO/BoostNote.next/files/5519570/math-test.pdf) - [math-test_dark.pdf](https://github.com/BoostIO/BoostNote.next/files/5519658/math-test_dark.pdf) - [math-test_sepia.pdf](https://github.com/BoostIO/BoostNote.next/files/5519659/math-test_sepia.pdf) - [math-test_white.pdf](https://github.com/BoostIO/BoostNote.next/files/5519660/math-test_white.pdf) - [math-test-front-matter-with-tag.pdf](https://github.com/BoostIO/BoostNote.next/files/5564821/math-test-front-matter.pdf) ### Todo: - [x] Refactor paths from "node_modules" to actual paths in production - [x] See how to test this better for all app versions (Linux, Windows, Web, Mac, Mobile) - [x] See if we can remove dependency to previewStyle (removing first N lines etc) - [ ] See if we can add nicer menu item icons (instead of text) for exporting - [ ] See if we can add some PDF export options (pageSize: A3, A4, landscape: mode, ...) <!-- Issuehunt content --> --- <details> <summary> <b>IssueHunt Summary</b> </summary> ### Referenced issues This pull request has been submitted to: - [#243: Re-Add Export as PDF option to the export list](https://issuehunt.io/repos/74213528/issues/243) --- </details> <!-- /Issuehunt content--> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 00:23:23 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/BoostNote-App#826
No description provided.