[PR #716] [MERGED] Add attachment rendering in PDF and HTML #863

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

📋 Pull Request Information

Original PR: https://github.com/BoostIO/BoostNote-App/pull/716
Author: @Komediruzecki
Created: 12/11/2020
Status: Merged
Merged: 12/17/2020
Merged by: @Rokt33r

Base: masterHead: feature/add-image-support-for-exports


📝 Commits (2)

  • a8ba2d5 Add attachment rendering in PDF and HTML
  • cb0d4d5 Fix arrow functions and downloadBlob

📊 Changes

2 files changed (+147 additions, -11 deletions)

View changed files

📝 src/components/organisms/NotePageToolbar.tsx (+16 -0)
📝 src/lib/exports.ts (+131 -11)

📄 Description

Add attachment rendering in PDF and HTML

  • Add attachment getter in PDF export (exports.ts)
  • Add parsing note md content to replace <img src='id'> with valid note image id
    • id blob is replaced with object url link in PDF export
    • id blob is replaced with base64 encoding of the image
  • Update downloadBlob to have cleanup callback (for revoking objectURLs in PDF export)

How it works:
Users can export the PDF and HTML and any image link attached to document which renders well in markdown preview should be exported inside downloaded PDF and HTML (see more details in commit description).

How it looks:
- md:

- result: PDF & HTML

Test:

  • In electron Linux App (dev)
    • Test exporting PDF & HTML in local file system storage
  • In electron Linux App production version (appImage)
    • Test exporting PDF & HTML from local file system storage
    • Test exporting PDF & HTML from cloud storage

Test invalid attachements exporting, error message, see below:
NoSuchImagePushMessage

Error Handling:
If attachment cannot be found, it is skipped and error message is shown to the user. The exporting continues with all valid attachments.


🔄 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/716 **Author:** [@Komediruzecki](https://github.com/Komediruzecki) **Created:** 12/11/2020 **Status:** ✅ Merged **Merged:** 12/17/2020 **Merged by:** [@Rokt33r](https://github.com/Rokt33r) **Base:** `master` ← **Head:** `feature/add-image-support-for-exports` --- ### 📝 Commits (2) - [`a8ba2d5`](https://github.com/BoostIO/BoostNote-App/commit/a8ba2d5d8c448a0e1dd6f45f4704f6707e091c43) Add attachment rendering in PDF and HTML - [`cb0d4d5`](https://github.com/BoostIO/BoostNote-App/commit/cb0d4d53344d493ce19ea4276c1be2034bd2a99f) Fix arrow functions and downloadBlob ### 📊 Changes **2 files changed** (+147 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/components/organisms/NotePageToolbar.tsx` (+16 -0) 📝 `src/lib/exports.ts` (+131 -11) </details> ### 📄 Description Add attachment rendering in PDF and HTML - Add attachment getter in PDF export (exports.ts) - Add parsing note md content to replace `<img src='id'>` with valid note image id - id blob is replaced with object url link in PDF export - id blob is replaced with base64 encoding of the image - Update downloadBlob to have cleanup callback (for revoking objectURLs in PDF export) How it works: Users can export the PDF and HTML and any image link attached to document which renders well in markdown preview should be exported inside downloaded PDF and HTML (see more details in commit description). How it looks: **- md:** - [ImageGlobalSearchPDFExport.txt](https://github.com/BoostIO/BoostNote.next/files/5681100/ImageGlobalSearchPDFExport.txt) - [ImagesOnlyGlobalSearchPDFExport.txt](https://github.com/BoostIO/BoostNote.next/files/5681101/ImagesOnlyGlobalSearchPDFExport.txt) **- result: PDF & HTML** - [PDFExportDarkTheme.pdf](https://github.com/BoostIO/BoostNote.next/files/5681103/ImagesOnlyGlobalSearchPDFExportDarkTheme.pdf) - [PDFExportWhiteTheme.pdf](https://github.com/BoostIO/BoostNote.next/files/5681121/ImagesOnlyGlobalSearchPDFExportWhiteTheme.pdf) - [HTMLExport.txt](https://github.com/BoostIO/BoostNote.next/files/5681112/HTMLExport.txt) **Test:** - In electron Linux App (dev) - Test exporting PDF & HTML in local file system storage - In electron Linux App production version (appImage) - Test exporting PDF & HTML from local file system storage - Test exporting PDF & HTML from cloud storage Test invalid attachements exporting, error message, see below: ![NoSuchImagePushMessage](https://user-images.githubusercontent.com/18196945/101944711-6ef88200-3bed-11eb-8723-36fe87b1764f.png) **Error Handling:** If attachment cannot be found, it is skipped and error message is shown to the user. The exporting continues with all valid attachments. --- <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:32 +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#863
No description provided.