Generates thumbnail for PDF file automatically after file is uploaded to the Media library.
You can also generate thumbnails for old PDF files that are already in the Media library – you can generate missing thumbnails or regenerate all thumbnails.
Imagick library must be installed on your server, otherwise this plugin will not work
Maybe you want to display PDF thumbnail by using a shortcode
[pdf_thumbnail id="123"]
Maybe you want to display PDF thumbnail url by using a shortcode
[pdf_thumbnail_url id="123"]
If you want to return PDF thumbnail URL you can use
get_pdf_thumbnail_url( $pdf_id )
it works similar to wp_get_attachment_url and it will return something like
https://site.com/wp-content/uploads/2022/01/example.pdf.png
If you want to return PDF thumbnail URL you can use
get_pdf_thumbnail_path( $pdf_id )
it works similar to get_attached_file and it will return something like
/www/site.com/wp-content/uploads/2022/01/example.pdf.png
If you want to return PDF thumbnail url, width and height you can use
get_pdf_thumbnail_image_src( $pdf_id )
it works similar to wp_get_attachment_image_src and it will return something like
[ 0 => 'https://site.com/wp-content/uploads/2022/01/example.pdf.png', 1 => 600, 2 => 800 ]
If you want to return PDF thumbnail image tag you can use
get_pdf_thumbnail_image( $pdf_id )
it works similar to wp_get_attachment_image and it will return something like
<img src="https://site.com/wp-content/uploads/2022/01/example.pdf.png" width="600" height="800" alt="example" loading="lazy">
Maybe you want to change global PDF thumbnail max_width for a specific PDF file
add_filter( 'pdf_thumbnail_max_width', function( $max_width, $pdf_id ){ if( $pdf_id == 123 ){ return 1024; } return $max_width; }, 10, 2 ); Maybe you want to change global PDF thumbnail max_width for a specific PDF file
add_filter( 'pdf_thumbnail_max_height', function( $max_height, $pdf_id ){ if( $pdf_id == 123 ){ return 768; } return $max_height; }, 10, 2 ); Maybe you want to change global PDF thumbnail quality for a specific PDF file
add_filter( 'pdf_thumbnail_quality', function( $quality, $pdf_id ){ if( $pdf_id == 123 ){ return 100; } return $quality; }, 10, 2 ); Maybe you want to change global PDF thumbnail file type for a specific PDF file
add_filter( 'pdf_thumbnail_type', function( $type, $pdf_id ){ if( $pdf_id == 123 ){ return 'png'; // or 'jpg' } return $type; }, 10, 2 ); Maybe you want to change default PDF thumbnail background for a specific PDF file
add_filter( 'pdf_thumbnail_bgcolor', function( $bgcolor, $pdf_id ){ if( $pdf_id == 123 ){ return 'black'; // default is 'white' } return $bgcolor; }, 10, 2 ); Maybe you want to PDF thumbnail page number for a specific PDF file
add_filter( 'pdf_thumbnail_page_number', function( $page, $pdf_id ){ if( $pdf_id == 123 ){ return 1; // default is 0 } return $page; }, 10, 2 ); Maybe you want to PDF thumbnail filename for a specific PDF file
add_filter( 'pdf_thumbnail_filename', function( $filename, $pdf_id ){ if( $pdf_id == 123 ){ return str_replace( '.pdf.png', '.png', $filename ); } return $filename; }, 10, 2 ); Maybe you want to add watermark to PDF thumbnail for a specific PDF file
add_filter( 'pdf_thumbnail_imagick', function( $imagick, $pdf_id ){ if( $pdf_id == 123 ){ // add your watermark here } return $imagick; }, 10, 2 ); Maybe you want to change attributes for image tag from get_pdf_thumbnail_image function
add_filter( 'get_pdf_thumbnail_image_attributes', function( $attr, $pdf_id ){ $attr['loading'] = 'eager'; return $attr; }, 10, 2 ); Maybe you want to do something after the thumbnail is generated
add_action( 'pdf_thumbnail_generated', function( $thumbnail_path, $pdf_id ){ // do somthing with the local file $thumbnail_path }, 10, 2 ); Starting from $0 per month.
Rating
Reviewers
3 reviews
Tags
Developed By
kubiq
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Create and customize product catalogs with a catalog widget that organizes items clearly, improves browsing, and helps visitors explore your offerings easily.
Show Sitejabber reviews to build trust, strengthen credibility, and help visitors make confident purchase decisions that support higher sales.
Use a process widget to present tasks in a clear visual sequence, showing each step with images and text to improve understanding and user engagement.
Showcase content with a card slider that presents images, text, and buttons in a smooth, customizable layout to keep visitors engaged.
Use a Lottie player to embed lightweight JSON animations that improve visual design, keep pages fast, and create a smoother user experience.
Add an FAQ section to your site to answer common questions, reduce support requests, and give visitors a smoother and more confident user experience.
Add a countdown bar to your site to create urgency, highlight limited time offers, and drive faster engagement and higher conversions.
Add customizable content cards to your site to display structured information clearly with flexible layout and design options.
Show eBay reviews to build trust, strengthen credibility, and help visitors make confident purchase decisions that support higher sales.
Add interactive video overlays with links, product cards, and buttons that appear on top of your videos to boost engagement and guide user actions.
Show Glassdoor reviews to highlight employee feedback, strengthen employer brand, and help candidates trust your company.
Collect candidate information with a job application form that organizes submissions, streamlines hiring, and helps you manage applicants efficiently.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
