qa
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
3 changed files
with
316 additions
and
0 deletions
| 1 | #, fuzzy | ||
| 2 | msgid "" | ||
| 3 | msgstr "" | ||
| 4 | "Project-Id-Version: PDF Thumbnail Generator\n" | ||
| 5 | "Report-Msgid-Bugs-To: \n" | ||
| 6 | "POT-Creation-Date: 2022-07-07 21:13+0000\n" | ||
| 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
| 8 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
| 9 | "Language-Team: \n" | ||
| 10 | "Language: \n" | ||
| 11 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" | ||
| 12 | "MIME-Version: 1.0\n" | ||
| 13 | "Content-Type: text/plain; charset=UTF-8\n" | ||
| 14 | "Content-Transfer-Encoding: 8bit\n" | ||
| 15 | "X-Generator: Loco https://localise.biz/\n" | ||
| 16 | "X-Loco-Version: 2.6.2; wp-6.0\n" | ||
| 17 | "X-Domain: pdf-thumbnail-generator" | ||
| 18 | |||
| 19 | #: pdf-thumbnail-generator.php:113 | ||
| 20 | msgid "Back to the settings" | ||
| 21 | msgstr "" | ||
| 22 | |||
| 23 | #: pdf-thumbnail-generator.php:185 | ||
| 24 | msgid "Generate missing PDF thumbnails" | ||
| 25 | msgstr "" | ||
| 26 | |||
| 27 | #: pdf-thumbnail-generator.php:180 | ||
| 28 | msgid "Generate thumbnails for already uploaded PDFs" | ||
| 29 | msgstr "" | ||
| 30 | |||
| 31 | #: pdf-thumbnail-generator.php:111 | ||
| 32 | #, php-format | ||
| 33 | msgid "Generated thumbnails: %d" | ||
| 34 | msgstr "" | ||
| 35 | |||
| 36 | #. Description of the plugin | ||
| 37 | msgid "Generates thumbnail for PDF files" | ||
| 38 | msgstr "" | ||
| 39 | |||
| 40 | #: pdf-thumbnail-generator.php:88 | ||
| 41 | msgid "Generating PDF thumbnails..." | ||
| 42 | msgstr "" | ||
| 43 | |||
| 44 | #: pdf-thumbnail-generator.php:182 | ||
| 45 | msgid "If you changed some settings, please save them firstly." | ||
| 46 | msgstr "" | ||
| 47 | |||
| 48 | #: pdf-thumbnail-generator.php:46 | ||
| 49 | msgid "" | ||
| 50 | "Imagick is missing on your server. PDF Thumbnail Generator can not work " | ||
| 51 | "without it." | ||
| 52 | msgstr "" | ||
| 53 | |||
| 54 | #: pdf-thumbnail-generator.php:148 | ||
| 55 | msgid "Max height" | ||
| 56 | msgstr "" | ||
| 57 | |||
| 58 | #: pdf-thumbnail-generator.php:140 | ||
| 59 | msgid "Max width" | ||
| 60 | msgstr "" | ||
| 61 | |||
| 62 | #: pdf-thumbnail-generator.php:101 | ||
| 63 | #, php-format | ||
| 64 | msgid "New thumbnail was generated for %d" | ||
| 65 | msgstr "" | ||
| 66 | |||
| 67 | #. Name of the plugin | ||
| 68 | msgid "PDF Thumbnail Generator" | ||
| 69 | msgstr "" | ||
| 70 | |||
| 71 | #: pdf-thumbnail-generator.php:58 pdf-thumbnail-generator.php:59 | ||
| 72 | #: pdf-thumbnail-generator.php:132 | ||
| 73 | msgid "PDF Thumbnails" | ||
| 74 | msgstr "" | ||
| 75 | |||
| 76 | #: pdf-thumbnail-generator.php:156 | ||
| 77 | msgid "Quality" | ||
| 78 | msgstr "" | ||
| 79 | |||
| 80 | #: pdf-thumbnail-generator.php:189 | ||
| 81 | msgid "Regenerate all PDF thumbnails" | ||
| 82 | msgstr "" | ||
| 83 | |||
| 84 | #: pdf-thumbnail-generator.php:177 | ||
| 85 | msgid "Save" | ||
| 86 | msgstr "" | ||
| 87 | |||
| 88 | #: pdf-thumbnail-generator.php:68 | ||
| 89 | msgid "Settings" | ||
| 90 | msgstr "" | ||
| 91 | |||
| 92 | #: pdf-thumbnail-generator.php:133 | ||
| 93 | msgid "Settings saved." | ||
| 94 | msgstr "" | ||
| 95 | |||
| 96 | #: pdf-thumbnail-generator.php:103 pdf-thumbnail-generator.php:106 | ||
| 97 | #, php-format | ||
| 98 | msgid "Thumbnail already exists for %d" | ||
| 99 | msgstr "" | ||
| 100 | |||
| 101 | #: pdf-thumbnail-generator.php:164 | ||
| 102 | msgid "Type" | ||
| 103 | msgstr "" |
This diff is collapsed.
Click to expand it.
| 1 | === PDF Thumbnail Generator === | ||
| 2 | Contributors: kubiq | ||
| 3 | Donate link: https://www.paypal.me/jakubnovaksl | ||
| 4 | Tags: pdf, image, thumbnail, generator, creator | ||
| 5 | Requires at least: 3.0.1 | ||
| 6 | Requires PHP: 5.6 | ||
| 7 | Tested up to: 6.4 | ||
| 8 | Stable tag: 1.1 | ||
| 9 | License: GPLv2 or later | ||
| 10 | License URI: http://www.gnu.org/licenses/gpl-2.0.html | ||
| 11 | |||
| 12 | Generates thumbnail for PDF files | ||
| 13 | |||
| 14 | |||
| 15 | == Description == | ||
| 16 | |||
| 17 | Generates thumbnail for PDF file automatically after file is uploaded to the Media library. | ||
| 18 | |||
| 19 | 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. | ||
| 20 | |||
| 21 | <strong>Imagick library must be installed on your server, otherwise this plugin will not work</strong> | ||
| 22 | |||
| 23 | <ul> | ||
| 24 | <li>automated test after plugin activation to make sure it will work on your server</li> | ||
| 25 | <li>works with all types of WordPress installations: domain, subdomain, subdirectory, multisite/network</li> | ||
| 26 | <li>works on Apache and NGiNX</li> | ||
| 27 | <li>automatically generate thumbnail for new uploaded PDFs</li> | ||
| 28 | <li>(re)generate thumbnails for existing PDFs in Media library</li> | ||
| 29 | <li>set maximum width of PDF thumbnail</li> | ||
| 30 | <li>set maximum height of PDF thumbnail</li> | ||
| 31 | <li>set image quality of PDF thumbnail</li> | ||
| 32 | <li>set image file type of PDF thumbnail</li> | ||
| 33 | </ul> | ||
| 34 | |||
| 35 | ## Shortcodes | ||
| 36 | |||
| 37 | ### pdf_thumbnail | ||
| 38 | Maybe you want to display PDF thumbnail by using a shortcode | ||
| 39 | |||
| 40 | `[pdf_thumbnail id="123"]` | ||
| 41 | |||
| 42 | ### pdf_thumbnail_url | ||
| 43 | Maybe you want to display PDF thumbnail url by using a shortcode | ||
| 44 | |||
| 45 | `[pdf_thumbnail_url id="123"]` | ||
| 46 | |||
| 47 | ## Functions | ||
| 48 | |||
| 49 | ### get_pdf_thumbnail_url | ||
| 50 | If you want to return PDF thumbnail URL you can use | ||
| 51 | |||
| 52 | `get_pdf_thumbnail_url( $pdf_id )` | ||
| 53 | |||
| 54 | it works similar to `wp_get_attachment_url` and it will return something like | ||
| 55 | |||
| 56 | `https://site.com/wp-content/uploads/2022/01/example.pdf.png` | ||
| 57 | |||
| 58 | ### get_pdf_thumbnail_path | ||
| 59 | If you want to return PDF thumbnail URL you can use | ||
| 60 | |||
| 61 | `get_pdf_thumbnail_path( $pdf_id )` | ||
| 62 | |||
| 63 | it works similar to `get_attached_file` and it will return something like | ||
| 64 | |||
| 65 | `/www/site.com/wp-content/uploads/2022/01/example.pdf.png` | ||
| 66 | |||
| 67 | ### get_pdf_thumbnail_image_src | ||
| 68 | If you want to return PDF thumbnail url, width and height you can use | ||
| 69 | |||
| 70 | `get_pdf_thumbnail_image_src( $pdf_id )` | ||
| 71 | |||
| 72 | it works similar to `wp_get_attachment_image_src` and it will return something like | ||
| 73 | |||
| 74 | `[ | ||
| 75 | 0 => 'https://site.com/wp-content/uploads/2022/01/example.pdf.png', | ||
| 76 | 1 => 600, | ||
| 77 | 2 => 800 | ||
| 78 | ]` | ||
| 79 | |||
| 80 | ### get_pdf_thumbnail_image | ||
| 81 | If you want to return PDF thumbnail image tag you can use | ||
| 82 | |||
| 83 | `get_pdf_thumbnail_image( $pdf_id )` | ||
| 84 | |||
| 85 | it works similar to `wp_get_attachment_image` and it will return something like | ||
| 86 | |||
| 87 | `<img src="https://site.com/wp-content/uploads/2022/01/example.pdf.png" width="600" height="800" alt="example" loading="lazy">` | ||
| 88 | |||
| 89 | ## Hooks | ||
| 90 | |||
| 91 | ### pdf_thumbnail_max_width | ||
| 92 | Maybe you want to change global PDF thumbnail max_width for a specific PDF file | ||
| 93 | |||
| 94 | `add_filter( 'pdf_thumbnail_max_width', function( $max_width, $pdf_id ){ | ||
| 95 | if( $pdf_id == 123 ){ | ||
| 96 | return 1024; | ||
| 97 | } | ||
| 98 | return $max_width; | ||
| 99 | }, 10, 2 );` | ||
| 100 | |||
| 101 | ### pdf_thumbnail_max_height | ||
| 102 | Maybe you want to change global PDF thumbnail max_width for a specific PDF file | ||
| 103 | |||
| 104 | `add_filter( 'pdf_thumbnail_max_height', function( $max_height, $pdf_id ){ | ||
| 105 | if( $pdf_id == 123 ){ | ||
| 106 | return 768; | ||
| 107 | } | ||
| 108 | return $max_height; | ||
| 109 | }, 10, 2 );` | ||
| 110 | |||
| 111 | ### pdf_thumbnail_quality | ||
| 112 | Maybe you want to change global PDF thumbnail quality for a specific PDF file | ||
| 113 | |||
| 114 | `add_filter( 'pdf_thumbnail_quality', function( $quality, $pdf_id ){ | ||
| 115 | if( $pdf_id == 123 ){ | ||
| 116 | return 100; | ||
| 117 | } | ||
| 118 | return $quality; | ||
| 119 | }, 10, 2 );` | ||
| 120 | |||
| 121 | ### pdf_thumbnail_type | ||
| 122 | Maybe you want to change global PDF thumbnail file type for a specific PDF file | ||
| 123 | |||
| 124 | `add_filter( 'pdf_thumbnail_type', function( $type, $pdf_id ){ | ||
| 125 | if( $pdf_id == 123 ){ | ||
| 126 | return 'png'; // or 'jpg' | ||
| 127 | } | ||
| 128 | return $type; | ||
| 129 | }, 10, 2 );` | ||
| 130 | |||
| 131 | ### pdf_thumbnail_bgcolor | ||
| 132 | Maybe you want to change default PDF thumbnail background for a specific PDF file | ||
| 133 | |||
| 134 | `add_filter( 'pdf_thumbnail_bgcolor', function( $bgcolor, $pdf_id ){ | ||
| 135 | if( $pdf_id == 123 ){ | ||
| 136 | return 'black'; // default is 'white' | ||
| 137 | } | ||
| 138 | return $bgcolor; | ||
| 139 | }, 10, 2 );` | ||
| 140 | |||
| 141 | ### pdf_thumbnail_page_number | ||
| 142 | Maybe you want to PDF thumbnail page number for a specific PDF file | ||
| 143 | |||
| 144 | `add_filter( 'pdf_thumbnail_page_number', function( $page, $pdf_id ){ | ||
| 145 | if( $pdf_id == 123 ){ | ||
| 146 | return 1; // default is 0 | ||
| 147 | } | ||
| 148 | return $page; | ||
| 149 | }, 10, 2 );` | ||
| 150 | |||
| 151 | ### pdf_thumbnail_filename | ||
| 152 | Maybe you want to PDF thumbnail filename for a specific PDF file | ||
| 153 | |||
| 154 | `add_filter( 'pdf_thumbnail_filename', function( $filename, $pdf_id ){ | ||
| 155 | if( $pdf_id == 123 ){ | ||
| 156 | return str_replace( '.pdf.png', '.png', $filename ); | ||
| 157 | } | ||
| 158 | return $filename; | ||
| 159 | }, 10, 2 );` | ||
| 160 | |||
| 161 | ### pdf_thumbnail_imagick | ||
| 162 | Maybe you want to add watermark to PDF thumbnail for a specific PDF file | ||
| 163 | |||
| 164 | `add_filter( 'pdf_thumbnail_imagick', function( $imagick, $pdf_id ){ | ||
| 165 | if( $pdf_id == 123 ){ | ||
| 166 | // add your watermark here | ||
| 167 | } | ||
| 168 | return $imagick; | ||
| 169 | }, 10, 2 );` | ||
| 170 | |||
| 171 | ### get_pdf_thumbnail_image_attributes | ||
| 172 | Maybe you want to change attributes for image tag from `get_pdf_thumbnail_image` function | ||
| 173 | |||
| 174 | `add_filter( 'get_pdf_thumbnail_image_attributes', function( $attr, $pdf_id ){ | ||
| 175 | $attr['loading'] = 'eager'; | ||
| 176 | return $attr; | ||
| 177 | }, 10, 2 );` | ||
| 178 | |||
| 179 | ### pdf_thumbnail_generated | ||
| 180 | Maybe you want to do something after the thumbnail is generated | ||
| 181 | |||
| 182 | `add_action( 'pdf_thumbnail_generated', function( $thumbnail_path, $pdf_id ){ | ||
| 183 | // do somthing with the local file $thumbnail_path | ||
| 184 | }, 10, 2 );` | ||
| 185 | |||
| 186 | |||
| 187 | == Installation == | ||
| 188 | |||
| 189 | 1. Upload `pdf-thumbnail-generator` directory to the `/wp-content/plugins/` directory | ||
| 190 | 2. Activate the plugin through the 'Plugins' menu in WordPress | ||
| 191 | |||
| 192 | |||
| 193 | == Frequently Asked Questions == | ||
| 194 | |||
| 195 | = Plugin requirements = | ||
| 196 | |||
| 197 | PHP 5.6 or higher | ||
| 198 | Imagick extension | ||
| 199 | |||
| 200 | = PDF thumbnails stored location = | ||
| 201 | |||
| 202 | PDF thumbnails are generated in the same directory as original PDF file. Example: | ||
| 203 | pdf file: `/wp-content/uploads/2022/01/example.pdf` | ||
| 204 | thumbnail: `/wp-content/uploads/2022/01/example.pdf.png` | ||
| 205 | |||
| 206 | |||
| 207 | == Changelog == | ||
| 208 | |||
| 209 | = 1.1 = | ||
| 210 | * tested on WP 6.4 | ||
| 211 | |||
| 212 | = 1.0 = | ||
| 213 | * First version | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment