95429ce8 by Jeff Balicki

pdf thumb

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent da35d68c
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PDF Thumbnail Generator\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-07 21:13+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: \n"
"Language: \n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.6.2; wp-6.0\n"
"X-Domain: pdf-thumbnail-generator"
#: pdf-thumbnail-generator.php:113
msgid "Back to the settings"
msgstr ""
#: pdf-thumbnail-generator.php:185
msgid "Generate missing PDF thumbnails"
msgstr ""
#: pdf-thumbnail-generator.php:180
msgid "Generate thumbnails for already uploaded PDFs"
msgstr ""
#: pdf-thumbnail-generator.php:111
#, php-format
msgid "Generated thumbnails: %d"
msgstr ""
#. Description of the plugin
msgid "Generates thumbnail for PDF files"
msgstr ""
#: pdf-thumbnail-generator.php:88
msgid "Generating PDF thumbnails..."
msgstr ""
#: pdf-thumbnail-generator.php:182
msgid "If you changed some settings, please save them firstly."
msgstr ""
#: pdf-thumbnail-generator.php:46
msgid ""
"Imagick is missing on your server. PDF Thumbnail Generator can not work "
"without it."
msgstr ""
#: pdf-thumbnail-generator.php:148
msgid "Max height"
msgstr ""
#: pdf-thumbnail-generator.php:140
msgid "Max width"
msgstr ""
#: pdf-thumbnail-generator.php:101
#, php-format
msgid "New thumbnail was generated for %d"
msgstr ""
#. Name of the plugin
msgid "PDF Thumbnail Generator"
msgstr ""
#: pdf-thumbnail-generator.php:58 pdf-thumbnail-generator.php:59
#: pdf-thumbnail-generator.php:132
msgid "PDF Thumbnails"
msgstr ""
#: pdf-thumbnail-generator.php:156
msgid "Quality"
msgstr ""
#: pdf-thumbnail-generator.php:189
msgid "Regenerate all PDF thumbnails"
msgstr ""
#: pdf-thumbnail-generator.php:177
msgid "Save"
msgstr ""
#: pdf-thumbnail-generator.php:68
msgid "Settings"
msgstr ""
#: pdf-thumbnail-generator.php:133
msgid "Settings saved."
msgstr ""
#: pdf-thumbnail-generator.php:103 pdf-thumbnail-generator.php:106
#, php-format
msgid "Thumbnail already exists for %d"
msgstr ""
#: pdf-thumbnail-generator.php:164
msgid "Type"
msgstr ""
=== PDF Thumbnail Generator ===
Contributors: kubiq
Donate link: https://www.paypal.me/jakubnovaksl
Tags: pdf, image, thumbnail, generator, creator
Requires at least: 3.0.1
Requires PHP: 5.6
Tested up to: 6.4
Stable tag: 1.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Generates thumbnail for PDF files
== Description ==
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.
<strong>Imagick library must be installed on your server, otherwise this plugin will not work</strong>
<ul>
<li>automated test after plugin activation to make sure it will work on your server</li>
<li>works with all types of WordPress installations: domain, subdomain, subdirectory, multisite/network</li>
<li>works on Apache and NGiNX</li>
<li>automatically generate thumbnail for new uploaded PDFs</li>
<li>(re)generate thumbnails for existing PDFs in Media library</li>
<li>set maximum width of PDF thumbnail</li>
<li>set maximum height of PDF thumbnail</li>
<li>set image quality of PDF thumbnail</li>
<li>set image file type of PDF thumbnail</li>
</ul>
## Shortcodes
### pdf_thumbnail
Maybe you want to display PDF thumbnail by using a shortcode
`[pdf_thumbnail id="123"]`
### pdf_thumbnail_url
Maybe you want to display PDF thumbnail url by using a shortcode
`[pdf_thumbnail_url id="123"]`
 
## Functions
### get_pdf_thumbnail_url
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`
### get_pdf_thumbnail_path
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`
### get_pdf_thumbnail_image_src
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
]`
### get_pdf_thumbnail_image
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">`
 
## Hooks
### pdf_thumbnail_max_width
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 );`
### pdf_thumbnail_max_height
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 );`
### pdf_thumbnail_quality
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 );`
### pdf_thumbnail_type
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 );`
### pdf_thumbnail_bgcolor
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 );`
### pdf_thumbnail_page_number
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 );`
### pdf_thumbnail_filename
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 );`
### pdf_thumbnail_imagick
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 );`
### get_pdf_thumbnail_image_attributes
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 );`
### pdf_thumbnail_generated
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 );`
== Installation ==
1. Upload `pdf-thumbnail-generator` directory to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
== Frequently Asked Questions ==
= Plugin requirements =
PHP 5.6 or higher
Imagick extension
= PDF thumbnails stored location =
PDF thumbnails are generated in the same directory as original PDF file. Example:
pdf file: `/wp-content/uploads/2022/01/example.pdf`
thumbnail: `/wp-content/uploads/2022/01/example.pdf.png`
== Changelog ==
= 1.1 =
* tested on WP 6.4
= 1.0 =
* First version
\ No newline at end of file