threadi / downloadlist

Provides a Wordpress-Gutenberg block for capturing a download list with file type specific icons.
https://wordpress.org/plugins/download-list-block-with-icons/
6 stars 0 forks source link

Add PDF thumbnail #33

Open typometre opened 1 year ago

typometre commented 1 year ago

Hi, I have a used case where I need to display thumbnail for each file. I have made my own version of your plugin for that. This is what the result looks like http://typomet.re/i/rFmpp1 Front end

I don't have the skills and knowledge in Js, webpack, react and all so I only changed the php for the output and managed to add controls to hide thumbnail and filename based on the finished and deployed plugin files. So the block in gutenberg is unchanged, from you version, only the new controls are added. I use the pdf thumbnail Wordpress provides when the servers as imagemagick and ghostscript. It shows file icon when there is no such thumbnail. Ultimately i would like to add the possibility to choose a specific image to act as the thumbnail.

What I ve done is dirty but meets my need and in case you would like to evolve your plugin I could send you my version. I didn't know how to use webpack or the build process required so I can't really make a proper fork and Pull request. Best regards.

threadi commented 11 months ago

Hi,

sorry for the very late reply. In the meantime, the plugin has been further developed and with the iconsets I have also created a possibility that you can theoretically display preview images of the files (including PDFs). There is an additional plugin whose repository can be found here: https://github.com/threadi/download-list-preview - you are welcome to test it to see if it would be suitable. You are also welcome to contribute code there that could further optimize the whole thing - in my opinion, the PDF preview generation in particular is a bit problematic because not every hosting offers the possibilities.