Hello !
Is it possible to add the thumbnails in media library?
Indeed I would like to create posts, add a pdf in a ACF field, and add the PDF thumbnail as post feature image. After I will use those post dynamically.
It can be done pretty quickly if I can find this thumbnail in media library.
Here with shortcode it’s too complicated.
Do you think we can make it work this way ?
Thanks
Correct me if I am wrong, but I’d like to note that “id” in the shortcode refers to the PDF attachment ID, and not to the generated thumbnail ID. It took me some time scratching my head wondering how we are supposed to know the ID before coming to this realisation.
If I am indeed correct, may I suggest clarifying this point in the README?
Thanks!
]]>I’ve just downloaded this plugin, and am working on integrating it into a template file. Thanks so much for making this available!
When I try to output one of the thumbnail images (using either the shortcode or the get_pdf_thumbnail_image template tag) I get this notice:
Deprecated: Function wp_get_loading_attr_default is deprecated since version 6.3.0! Use wp_get_loading_optimization_attributes() instead. in /{pathtomyfiles}/wp-includes/functions.php on line 6078
wp_get_loading_attr_default appears on line 367 of your plugin.
Any update in the works for that? Any work-around that you can suggest in the meantime?
]]>Hi there,
I’m using your plugin with Advanced Custom Fields and WPML, and I’ve encountered an issue that I need your help with. When I upload a PDF for the default language and then duplicate the post type for a secondary language, the fields are prefilled with the PDF, but the PDF thumbnail doesn’t appear unless I use a different PDF or upload a new one. Is there a way to fix this so that the thumbnail appears correctly for the secondary language? Right now I manually regenerated the thumbnail using “
Generate missing PDF thumbnails” but that isn’t ideal.
Thanks in advance!
]]>Hi,
On error, it use error_log on line 260 and 262.
I wish REPLACE with send_exception so i can catch error.
I mean today it’s only in debug.log file.
With exception i can easy use my already existing module to perform some actions like, logging error in database, sending email on error and some orther.
If needed, i can send you my module.
Thanks
]]>Good Afternoon,
We are currently trying to use your plugin on one of our website however whenever we try to activate it causes a fatal error with the following message “Plugin could not be activated because it triggered a?fatal error“.
We have Imagick installed as well in our server, the PHP version we tried these on are 8.1 and 8.2, the OS of our server on CPanel is CentOS.
If you need anymore information please do let me know, many thanks.
]]>Hello, I want to display a page with PDFs to download, and I would like to have thumbnails of the PDFs on these pages. I made a “documentations” CPT with an ACF of file type “PDF File”. I use Elementor Pro and in my theme builder I make a loop in which I would like to retrieve the thumbnail of the PDF (which I see in my library on the PDF as an image generated by WordPress from the first page of the PDF). But I can’t find that in the dynamic image options. Is there a solution?
THANKS
This is what the error log says:
[12-Feb-2024 18:19:44 UTC] ImagickException: attempt to perform an operation not allowed by the security policy `PDF’ @ error/constitute.c/IsCoderAuthorized/422 in /data/web/joh.bsoft.de/wp-content/plugins/pdf-thumbnail-generator/pdf-thumbnail-generator.php:236
Stack trace: 0 /data/web/joh.bsoft.de/wp-content/plugins/pdf-thumbnail-generator/pdf-thumbnail-generator.php(236): Imagick->readImage() 1 /data/web/joh.bsoft.de/wp-content/plugins/pdf-thumbnail-generator/pdf-thumbnail-generator.php(97): pdf_thumbnail_generator->generate_thumbnail() 2 /data/web/joh.bsoft.de/wp-includes/class-wp-hook.php(324): pdf_thumbnail_generator->admin_options_page() 3 /data/web/joh.bsoft.de/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 4 /data/web/joh.bsoft.de/wp-includes/plugin.php(517): WP_Hook->do_action() 5 /data/web/joh.bsoft.de/wp-admin/admin.php(259): do_action() 6 /data/web/joh.bsoft.de/wp-admin/options-general.php(10): require_once(‘/data/web/joh.b…’) 7 {main}
I did not define any special security policy, do you have any clue for me?
Tx Hanno
]]>Hi,
I’ve installed the plugin on my staging site in order to test it. And it works well with ImageMagick Engine ! But when I do the same process on my live site, it doesn’t work (functions or shortcodes).
The plugin doesn’t shows thumbnails. Any ideas ?
]]>Hello, I started using this great plugin a few months ago to generate thumbnails uploaded using Formidable Forms. However, thumbnails no longer get generated automatically for newly uploaded PDFS until I click on “Generate Missing PDF Thumbnails”. This only affects PDFs uploaded from the front-end via a Formidable Form; PDFs uploaded directly in the Media Library still get generated.
WordPress Version 6.4.2
PDF Thumbnail Generator Version 1.1
Formidable Forms Pro 6.7
Hi, after running the plugin, some files, that supposedly now had a preview image did not. When I klicked on the image in the media collection, I had error message e.g.:
Warning: exif_imagetypeUhome/customer/www/xn--knstlerisch-geformt-59b.com/public_html/wp-includes/images/media/Atwood-Venus-Leier.pdf.png}: failed to open stream: No such file or directory in /home/customer/www/xn--knstlerisch-geformt-59b.com/public_html/wp-includes/functions.php on line 3310
Warning: file_get_contentsUhome/customer/www/xn--knstlerisch-geformt-59b.com/public_html/wp-includes/images/media/Atwood-Venus-Leier.pdf.png): failed to open stream: No such file or directory in /home/customer/www/xn--knstlerisch-geformt-59b.com/public_html/wp-includes/functions.php on line 3332
Then I deactivated the plugin, no more error messages but also no more previews!!! How do it avoid the error messages and how can I run the plug in, uninstall it and keep the preview files!
]]>Hi.
I was expecting regeneration of thumbnails for existing PDFs to appear in the Media Library. This is not happening, although the images are created and are saved in the relevant uploads/{year}/{month} directory.
Is this expected behaviour? If not, how can I fix it?
If it is expected behaviour, is there a way to get the regenerated thumbnails to appear in the Media Library?
Many thanks.
]]>I’ve been trying for about 3 days to get this to work without success. My DEV server is running Imagick version 3.7.0 and Ghostscript version 9.50
I found a couple of stack related to this issue, but I am unsure what to do:
https://wordpress.stackexchange.com/questions/391803/why-are-thumbnails-not-being-generated-for-pdf-files
https://stackoverflow.com/questions/52703123/override-default-imagemagick-policy-xml
Any help would be much appreciated.
]]>Does the plugin auto generate a thumbnail image based on the first page of a PDF? Is there a way to control which page the plugin uses to generate a Thumbnail? Reason I ask is because I have a client who is creating home listings and they have a PDF Spec sheet that goes with each listing. I want to auto generate the page that they show the floor plan and it’s not the first page of the PDF. I can just tell them that the thumbnail that gets generated is the 1st Page of the PDF? Let me know.
]]>Hello, I have tested you plugin but I really don’t need to generate image from every page in PDF ?? I tging I will be fine with standard preview generatin build in WP with ImageMagick but it stopped work suddenly…
My question is how to uninstall this plugin and clean 5171 files created and meta records in DB.
May be that wp media regenerate will cleanup after this plugin and deletes all?
Or I have to run an Query like:
DELETE?FROM?wpweb_postmeta
?WHERE?CONVERT(meta_key?USING?utf8)?LIKE?‘_pdf_thumbnail’;
and delete files listed on the server?
I have fonud a bit more files on FTP using pattern .*-pdf-[0-9]{1,3}\.jpg than are listed in DB.
Hi.
I’ve tried the shortcodes with the right id but nothing is shown. I’ve also tried to generate and re-generata all pdf thumbnails, but it only says:
Thumbnail already exists for …
and
Generated thumbnails: 0
But I don’t know if Imagick library is installed on the server…
]]>Inserting the PDF preview image through a shortcode works, but it’s not very user friendly. Please consider a block instead – ideally with the option to link to the corresponding PDF file easily. There are tons of WordPress users out there waiting for this functionality!
]]>This is definitely what I want to do:
get_pdf_thumbnail_image( $pdf_id )
But how do I get $pdf_id for the current Post?
Mark
]]>Hi there,
Thanks for this plug-in.
Our site has ceased generating thumbnails for PDFs. Not sure why. It has all the necessary components installed.
I am trying your plug-in to see if that helps.
I notice the “Regenerate all PDF thumbnails” doesn’t work. It comes back with exactly the same response as the “Generate missing PDF thumbnails ” button. Namely, “Thumbnail already exists for …”
Regards,
Jonathan