[PR #995] [MERGED] feat: Add PDF screenshot generation and display #1724

Closed
opened 2026-03-02 11:58:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karakeep-app/karakeep/pull/995
Author: @ahmadmucom
Created: 2/8/2025
Status: Merged
Merged: 2/17/2025
Merged by: @MohamedBassem

Base: mainHead: feat/pdf-thumbnail-preprocessing


📝 Commits (10+)

  • 9734ea1 Updated pdf2json to 3.1.5
  • 01173c4 Extract and store a screenshot from PDF files using pdf2pic
  • c9b3892 Installing graphicsmagick and ghostscript
  • 403f873 Generate Missing PDF screenshot with tidyAssets worker for backward support
  • b370b57 Display PDF screenshot instead of the PDF in web if it exists.
  • 4dae477 Display PDF screenshot in mobile app if exists.
  • b3c857a Updated pnpm-lock.yaml
  • 5caa9a1 Removed console.log
  • 6d59073 Revert the unnecessary changes in package.json
  • 050778e Revert pnpm-lock changes

📊 Changes

34 files changed (+545 additions, -101 deletions)

View changed files

📝 apps/mobile/components/bookmarks/BookmarkCard.tsx (+6 -1)
📝 apps/web/components/admin/AdminActions.tsx (+22 -0)
📝 apps/web/components/dashboard/bookmarks/AssetCard.tsx (+23 -5)
📝 apps/web/components/dashboard/preview/AssetContentSection.tsx (+103 -28)
📝 apps/web/components/dashboard/preview/AttachmentBox.tsx (+1 -0)
📝 apps/web/lib/i18n/locales/ar/translation.json (+27 -6)
📝 apps/web/lib/i18n/locales/da/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/de/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/en/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/es/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/fr/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/gl/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/hr/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/hu/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/it/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/pl/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/ru/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/tr/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/zh/translation.json (+2 -1)
📝 apps/web/lib/i18n/locales/zhtw/translation.json (+2 -1)

...and 14 more files

📄 Description

  • Add PDF to image conversion using pdf2pic library
  • Install graphicsmagick and ghostscript dependencies
  • Generate and store PDF screenshots during preprocessing
  • Add screenshot display support for web and mobile apps
  • Add missing PDF screenshot generation via tidyAssets worker
  • Update pdf2json to 3.1.5 for better parsing and removed old commits about the incorrect typing

This change improves PDF preview performance by generating and displaying static screenshots instead of loading full PDFs.
A fallback to PDF iframe display is maintained when screenshots are unavailable.


🔄 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/karakeep-app/karakeep/pull/995 **Author:** [@ahmadmucom](https://github.com/ahmadmucom) **Created:** 2/8/2025 **Status:** ✅ Merged **Merged:** 2/17/2025 **Merged by:** [@MohamedBassem](https://github.com/MohamedBassem) **Base:** `main` ← **Head:** `feat/pdf-thumbnail-preprocessing` --- ### 📝 Commits (10+) - [`9734ea1`](https://github.com/karakeep-app/karakeep/commit/9734ea1b75d45c66241cf8a043397d29cf424ff9) Updated pdf2json to 3.1.5 - [`01173c4`](https://github.com/karakeep-app/karakeep/commit/01173c42a73b4325300e4a0cb0f549529247fa00) Extract and store a screenshot from PDF files using pdf2pic - [`c9b3892`](https://github.com/karakeep-app/karakeep/commit/c9b38923ae114ed2e64fdeccd5dc0168b2de972b) Installing graphicsmagick and ghostscript - [`403f873`](https://github.com/karakeep-app/karakeep/commit/403f873623af16a601d4d90218d4c889255268cf) Generate Missing PDF screenshot with tidyAssets worker for backward support - [`b370b57`](https://github.com/karakeep-app/karakeep/commit/b370b57f2149792a335e5cc76124f298f0d80048) Display PDF screenshot instead of the PDF in web if it exists. - [`4dae477`](https://github.com/karakeep-app/karakeep/commit/4dae47795fb8b442289918ed8528ddca060f51ed) Display PDF screenshot in mobile app if exists. - [`b3c857a`](https://github.com/karakeep-app/karakeep/commit/b3c857a78aa88ca2d95a0ff424e9b48d7433893a) Updated pnpm-lock.yaml - [`5caa9a1`](https://github.com/karakeep-app/karakeep/commit/5caa9a16af6d3f0dbb6dc55f523d588fb5675e8e) Removed console.log - [`6d59073`](https://github.com/karakeep-app/karakeep/commit/6d5907338e3a407677fd6fd43847f8e90798b8c9) Revert the unnecessary changes in package.json - [`050778e`](https://github.com/karakeep-app/karakeep/commit/050778e51c24650cb86f64189a65dd0c337122d5) Revert pnpm-lock changes ### 📊 Changes **34 files changed** (+545 additions, -101 deletions) <details> <summary>View changed files</summary> 📝 `apps/mobile/components/bookmarks/BookmarkCard.tsx` (+6 -1) 📝 `apps/web/components/admin/AdminActions.tsx` (+22 -0) 📝 `apps/web/components/dashboard/bookmarks/AssetCard.tsx` (+23 -5) 📝 `apps/web/components/dashboard/preview/AssetContentSection.tsx` (+103 -28) 📝 `apps/web/components/dashboard/preview/AttachmentBox.tsx` (+1 -0) 📝 `apps/web/lib/i18n/locales/ar/translation.json` (+27 -6) 📝 `apps/web/lib/i18n/locales/da/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/de/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/en/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/es/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/fr/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/gl/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/hr/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/hu/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/it/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/pl/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/ru/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/tr/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/zh/translation.json` (+2 -1) 📝 `apps/web/lib/i18n/locales/zhtw/translation.json` (+2 -1) _...and 14 more files_ </details> ### 📄 Description - Add PDF to image conversion using pdf2pic library - Install graphicsmagick and ghostscript dependencies - Generate and store PDF screenshots during preprocessing - Add screenshot display support for web and mobile apps - Add missing PDF screenshot generation via tidyAssets worker - Update pdf2json to 3.1.5 for better parsing and removed old commits about the incorrect typing This change improves PDF preview performance by generating and displaying static screenshots instead of loading full PDFs. A fallback to PDF iframe display is maintained when screenshots are unavailable. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 11:58:54 +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/karakeep#1724
No description provided.