Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add PDF screenshot generation and display #995

Merged

Conversation

AhmadMuj
Copy link
Contributor

@AhmadMuj AhmadMuj commented Feb 8, 2025

  • 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.

Copy link
Collaborator

@MohamedBassem MohamedBassem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @AhmadMuj. Overall, looking good, left a bunch of review comments!

apps/workers/package.json Outdated Show resolved Hide resolved
apps/workers/assetPreprocessingWorker.ts Outdated Show resolved Hide resolved
apps/mobile/components/bookmarks/BookmarkCard.tsx Outdated Show resolved Hide resolved
apps/web/components/dashboard/bookmarks/AssetCard.tsx Outdated Show resolved Hide resolved
apps/workers/assetPreprocessingWorker.ts Outdated Show resolved Hide resolved
apps/workers/assetPreprocessingWorker.ts Outdated Show resolved Hide resolved
apps/workers/tidyAssetsWorker.ts Outdated Show resolved Hide resolved
pnpm-lock.yaml Outdated Show resolved Hide resolved
@AhmadMuj
Copy link
Contributor Author

@MohamedBassem Should be good to go. Let me know if there's anything.

@AhmadMuj
Copy link
Contributor Author

@MohamedBassem Sounds good to me

@MohamedBassem MohamedBassem merged commit e5cb9aa into hoarder-app:main Feb 17, 2025
4 checks passed
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.

3 participants