pdf thumbnails instead of generic icon
-
Hello Dan, thanks for such an awesome plugin: there is no other reliable plugin to show galleries of PDF documents so yours is the de facto standard for this requirement many WordPress developers have.
I installed it seamlessly on one of my WordPress sites, but the client asked for thumbnails of the first page of each PDF instead of the generic icon. After checking again there are no plugin around allowing for this feature, so I took the liberty to modify the models/class-document.php file of your plugin and the results left my client totally satisfied.
As I believe this feature can be further tested, polished and eventually added to a future version of Document Gallery, I’d like to show you the patch file I used to add this functionality so you can evaluate it by yourself:
Thanks once again for this plugin and keep the good work!
EDIT: For anyone interested in testing the patch, download the file to the same directory where the script to be patched resides (usually /wp-content/plugins/document-gallery/models), remove the .txt extension if present (pastebin downloads the file as class-document.php.patch.txt), open this location on Terminal (Mac: Applications > Utilities > Terminal, Windows: Start Menu > Run > cmd) and execute the line:
patch < class-document.php.patch
EDIT2: The new method checks for a png image named like the pdf file and in the same content folder, if it does not exists it creates one. ImageMagick and GhostScript libraries are required to be running on the server but most of decent web servers have them already. Some tweaks may be done to use GD2 instead.
- The topic ‘pdf thumbnails instead of generic icon’ is closed to new replies.