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

Add Preview for Pdfs #65

Closed
ishaanxgupta opened this issue Feb 11, 2025 · 5 comments
Closed

Add Preview for Pdfs #65

ishaanxgupta opened this issue Feb 11, 2025 · 5 comments
Assignees

Comments

@ishaanxgupta
Copy link
Contributor

The current implementation does not have a preview option for pdfs when selected for upload.

Tasks:-

  1. Add a proper preview for pdfs or view the pdf by downloading.
  2. Short pic of the pdf should also appear just like images.

Image

@ishaanxgupta
Copy link
Contributor Author

@pradeeban @mdxabu,
If this bug needs to be solved, Please assign this issue to me

@01bps
Copy link
Contributor

01bps commented Feb 15, 2025

Hi @ishaanxgupta ,
I saw the issue with PDF previews, and I’d love to help! Here, we can use pdf2image to convert the first page of a PDF into a thumbnail and serve it like an image for preview. This way, PDFs will have thumbnails just like images. Let me know if this approach works, and I’d be happy to assist in implementing it!

@ishaanxgupta
Copy link
Contributor Author

Hi @ishaanxgupta , I saw the issue with PDF previews, and I’d love to help! Here, we can use pdf2image to convert the first page of a PDF into a thumbnail and serve it like an image for preview. This way, PDFs will have thumbnails just like images. Let me know if this approach works, and I’d be happy to assist in implementing it!

Hi @01bps, i think pdf2image will not work because they have pre-requisites of Poppler, which will make this functionality complex.

@01bps
Copy link
Contributor

01bps commented Feb 16, 2025

Hi @ishaanxgupta , I saw the issue with PDF previews, and I’d love to help! Here, we can use pdf2image to convert the first page of a PDF into a thumbnail and serve it like an image for preview. This way, PDFs will have thumbnails just like images. Let me know if this approach works, and I’d be happy to assist in implementing it!

Hi @01bps, i think pdf2image will not work because they have pre-requisites of Poppler, which will make this functionality complex.

I don’t think Poppler generally makes any functionality complex.
But in case it’s becoming too complex , we can always explore other approaches that work best for us.

@ishaanxgupta
Copy link
Contributor Author

Hi @ishaanxgupta , I saw the issue with PDF previews, and I’d love to help! Here, we can use pdf2image to convert the first page of a PDF into a thumbnail and serve it like an image for preview. This way, PDFs will have thumbnails just like images. Let me know if this approach works, and I’d be happy to assist in implementing it!

Hi @01bps, i think pdf2image will not work because they have pre-requisites of Poppler, which will make this functionality complex.

I don’t think Poppler generally makes any functionality complex. But in case it’s becoming too complex , we can always explore other approaches that work best for us.

Yes, i researched and found another library, PyMuPDF, This works great and implemented both the tasks, will raise PR by evening

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

No branches or pull requests

2 participants