Linux 软件免费装
Banner图

Rapls PDF Image Creator – PDF Thumbnails & Featured Images

开发者
更新时间 2026年9月28日 11:33

标签

下载

1.4.6 1.0.7.1 1.0.9.5 1.4.2 1.1.1 1.4.7 1.4.8 1.4.9 1.0.9.2 1.0.9.3 1.1.0 1.0.9.7 1.0.9 1.0.9.8 1.0.9.4 1.4.1 1.0.6 1.0.9.1 1.0.9.10 1.0.9.9 1.2.1 1.3.0 1.4.3 1.4.4 1.4.5 1.0.7

详情介绍:

Rapls PDF Image Creator automatically generates thumbnail images when you upload PDF files to your WordPress Media Library. The plugin uses ImageMagick (Imagick PHP extension) to convert the first page of a PDF into an image. 👉 Setup guide & troubleshooting: How to fix CMYK black thumbnails and PDF/X issues Why this one On a server with an older Ghostscript, a PDF page can come back completely white -- and Ghostscript does not report it as an error. Anything that hands the page over and stores whatever comes back saves that white image, including WordPress's own PDF preview. It looks like a thumbnail. It looks like the job worked. Measured on a live shared host running Ghostscript 9.27, in a single upload: the built-in preview came back with a standard deviation of 0, one flat colour across every pixel. This plugin's thumbnail of the same page, in the same request, came back at 0.31. Key Features How It Works
  1. Upload a PDF file to the Media Library
  2. The plugin automatically converts the first page to an image
  3. The image is registered as the PDF's featured image
  4. Use shortcodes or template functions to display the thumbnail
Generated Files When you upload my-document.pdf, the plugin creates: Shortcodes Template Functions Requirements Most shared hosting providers have ImageMagick available. Check the Status tab in plugin settings to verify your server meets the requirements. Will it work on my server? PDF thumbnails depend on ImageMagick being able to read PDFs, and not every host allows that. Rapls PDF Image Creator checks by actually rendering a small test PDF, not by reading a configuration value, and tells you on the Status tab whether PDF rendering works on your server and, if not, what to ask your host for. Site Health flags it too when it doesn't.

安装:

  1. Upload the rapls-pdf-image-creator folder to /wp-content/plugins/
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Go to Settings > Rapls PDF Image Creator
  4. Check the Status tab to verify ImageMagick is available
  5. Upload a PDF to test thumbnail generation

屏幕截图:

  • Bulk Generate tab - Generate thumbnails for existing PDFs
  • Status tab - View ImageMagick availability and server capabilities
  • Media Library - PDFs display with generated thumbnail icons

升级注意事项:

1.4.9 A thumbnail is kept, not deleted, when the plugin cannot check whether something else still uses it. 1.4.8 Regenerating a thumbnail, or deleting a PDF, no longer deletes a thumbnail that a translated copy of the PDF or a post still uses. 1.4.7 Regenerating a thumbnail, or deleting a PDF, no longer deletes an image that is not that PDF's own thumbnail, such as a featured image set by another plugin. 1.4.6 A PDF whose chosen page is blank is no longer read in full, every page, each time its thumbnail is made. 1.4.5 Fixes a fatal error in the Media Library on WordPress 5.0 to 5.2. 1.4.4 With automatic generation off, WordPress's own PDF preview is now deleted from the right folder, instead of left on disk. 1.4.3 The Edit Media screen now shows a PDF's generated thumbnail instead of WordPress's own preview, which is blank for the PDFs the Ghostscript workaround exists for. 1.4.2 Asks for a review once, a week after activation, and only if the plugin has actually made a thumbnail here. One notice, on this plugin's own screen, and it does not come back. 1.4.1 A PDF that came back blank is now retried with a workaround for a known Ghostscript fault, and a regenerated thumbnail gets a filename of its own so browsers stop showing the old one. 1.4.0 When a thumbnail fails to generate, the Status tab now tells you why instead of leaving you with a PDF and no picture. A page that renders as a blank white image is refused rather than saved. Also checks whether picking a page other than the first actually works on your server. 1.3.2 The ImageMagick 6 CMYK warning is now based on rendering a test page instead of the version number, so servers where CMYK works are no longer warned. 1.3.1 Corrects the 1.3.0 detection. On servers whose ImageMagick policy forbids PDFs — the most common cause of missing thumbnails on shared hosting — 1.3.0 wrongly reported everything as working. Install this if you are on 1.3.0. 1.3.0 Diagnostics. Site Health now reports whether PDF thumbnails can be generated, activation warns when the server cannot render PDFs, and a missing ImageMagick is told apart from an ImageMagick that is forbidden to read PDFs. No change to how thumbnails are produced. 1.2.1 Translation fix: twelve admin strings that were stuck in English under a translated locale now display correctly. No functional change. 1.2.0 Adds a Rendering Resolution (DPI) setting for larger thumbnails. The default matches previous behavior, so nothing changes until you raise it. 1.1.0 Fixes oversaturated colors in thumbnails generated from CMYK PDFs. Existing thumbnails keep their old colors until you regenerate them from the Bulk Generate tab. 1.0.9.10 Fixes a PHP Fatal error ("Argument #5 ($attr) must be of type array, string given") that could occur on PHP 8 when displaying a PDF as an image. Update strongly recommended. 1.0.9.9 Fixes "Undefined array key width / height" PHP warnings introduced in 1.0.9.8 when a PDF-derived image is shown as a featured image on post-list pages. 1.0.9.8 Fixes an "Undefined array key file" PHP warning shown when a PDF embedded as an image is displayed on WordPress 6.9.x and earlier. 1.0.9.7 Tested up to WordPress 7.0. Compatibility verified. 1.0.6 PHP 7.4 compatibility fix and security improvements. Translation loading added. 1.0.5 GhostScript support removed per WordPress.org security requirements. ImageMagick (Imagick) is now required. 1.0.4 Major prefix changes for WordPress.org compliance. Update may require reconfiguration. 1.0.3 Plugin renamed with new slug. PHP 8.0+ compatibility improved. 1.0.0 Initial release.

其他记录:

Using Template Functions Display a PDF thumbnail in your theme: $pdf_id = 123; if ( rapls_pic_has_thumbnail( $pdf_id ) ) { echo rapls_pic_get_thumbnail_image( $pdf_id, 'medium' ); } Link thumbnail to PDF file: $pdf_id = 123; if ( $thumbnail_id = get_post_thumbnail_id( $pdf_id ) ) { echo '<a href="' . esc_url( wp_get_attachment_url( $pdf_id ) ) . '" target="_blank">'; echo wp_get_attachment_image( $thumbnail_id, 'medium' ); echo '</a>'; } Display All PDFs Attached to a Post ` $pdfs = get_posts( array( 'post_type' => 'attachment', 'post_mime_type' => 'application/pdf', 'post_parent' => get_the_ID(), 'posts_per_page' => -1, ) ); foreach ( $pdfs as $pdf ) { if ( rapls_pic_has_thumbnail( $pdf->ID ) ) { printf( '%s', esc_url( wp_get_attachment_url( $pdf->ID ) ), rapls_pic_get_thumbnail_image( $pdf->ID, 'thumbnail' ) ); } } ` Available Filter Hooks Color Conversion Filters Pointing the plugin at a specific pair of profiles: add_filter( 'rapls_pdf_image_creator_icc_paths', function( $paths, $type ) { if ( 'cmyk' === $type ) { return array( '/srv/icc/JapanColor2011Coated.icc' ); } return $paths; }, 10, 2 ); Available Action Hooks

常见问题:

Where can I find detailed documentation?

A full guide with setup instructions, the fix for the infamous "black thumbnail" problem (CMYK / PDF/X), and real-world usage tips:

What are the server requirements?

You need ImageMagick with the Imagick PHP extension and PDF support. Most shared hosting providers have this available. Contact your hosting provider if you need to enable it.

How do I check if my server supports PDF conversion?

Go to Settings > Rapls PDF Image Creator > Status tab. The plugin will show whether ImageMagick is available and properly configured. For detailed troubleshooting including common server setup issues, see the setup guide.

My thumbnail is a completely blank white image. What is wrong?

Check Settings > Rapls PDF Image Creator > Status. If it reports ImageMagick 6, that is the cause. ImageMagick 6 can render a PDF it judges to be CMYK through Ghostscript's bmpsep8 device, which writes a separation BMP that ImageMagick's own BMP reader cannot decode. Depending on the exact ImageMagick and Ghostscript versions, the read either fails outright or returns an empty raster — which becomes a blank white thumbnail. ImageMagick 7 uses a different device and is unaffected. Not every ImageMagick 6 build is affected: on Xserver's 6.9.13-25 a CMYK page renders correctly. Since 1.3.2 the Status tab renders a test page and reports what this server actually does, rather than warning on the version number. The plugin cannot work around this, because ImageMagick picks the device from the PDF's own content and no Imagick API call overrides it. Ask your hosting provider to upgrade to ImageMagick 7, or to change the ps:cmyk delegate in delegates.xml from bmpsep8 to pamcmyk32. RGB PDFs are not affected, which is why only some of your PDFs fail.

Why do my thumbnails look more vivid than the original PDF?

If the PDF uses CMYK colours and no ICC profile is available on your server, the plugin falls back to a simple arithmetic conversion, which exaggerates greens and blues. Check Settings > Rapls PDF Image Creator > Status to see whether ICC colour management is active. Installing a CMYK profile on the server, or pointing the rapls_pdf_image_creator_icc_paths filter at one, restores accurate colours.

I updated and my thumbnails still have the old colours. Why?

Thumbnails are not regenerated automatically, because regenerating every PDF on a large site during an update is not something a plugin should decide to do. Go to Settings > Rapls PDF Image Creator > Bulk Generate and regenerate them. If you would rather keep the previous colours, pin the old behaviour: add_filter( 'rapls_pdf_image_creator_color_conversion', function() { return 'naive'; } );

Can I generate thumbnails for PDFs uploaded before installing this plugin?

Yes. Go to Settings > Rapls PDF Image Creator > Bulk Generate tab to scan and generate thumbnails for all existing PDFs.

I raised Max Width and Max Height but the thumbnail is the same size. Why?

Those two settings only scale the rendered page down. They never enlarge it. The size the page is rendered at comes from Rendering Resolution instead, which was fixed at 150 DPI before version 1.2.0 — an A4 page at 150 DPI is about 1240x1754 pixels, and no maximum above that could produce anything bigger. Raise Rendering Resolution (Settings > Rapls PDF Image Creator > Image Settings) and the rendered page grows with it; the maximum dimensions then cap the result as before. Bear in mind that memory use during generation grows with the square of the resolution, so raise it in steps if your server is small.

I uploaded a PDF and no thumbnail appeared. How do I find out why?

Go to Tools > Site Health. The "PDF thumbnail generation" test says whether this server can render PDFs, and if not, what to ask your hosting provider for. The same report is on the Status tab of the plugin's settings page, and Site Health > Info has a Rapls PDF Image Creator section you can copy into a support request. There are two different server problems, and they need different requests:

  • The Imagick PHP extension is not installed. Ask your host to install and enable it. It is the PHP binding for ImageMagick.
  • ImageMagick is installed but its security policy forbids reading PDFs. Many hosts ship a policy.xml that denies the PDF coder, a precaution left over from a 2018 Ghostscript vulnerability. Ask your host to give the PDF coder read rights. The plugin shows the path of the file responsible.
The plugin tells these apart for you, so you do not have to guess which request to make.

What image formats are supported?

JPEG, PNG, and WebP. Configure your preferred format in the Image Settings tab.

Will thumbnails be deleted when I uninstall the plugin?

By default, yes. To keep generated images as regular attachments, enable "Keep Images on Uninstall" in Display Settings before uninstalling.

Can I use a different page for the thumbnail?

Yes. Use the rapls_pdf_image_creator_thumbnail_page filter: add_filter( 'rapls_pdf_image_creator_thumbnail_page', function( $page, $pdf_id ) { return 1; // Use second page (0-indexed) }, 10, 2 ); Without code, you can set the page for the whole site in Settings > Rapls PDF Image Creator > Page Number (0 is the first page).

How do I customize the insert output?

Go to Settings > Rapls PDF Image Creator > Insert Settings. Choose from Image only, Title link, or Custom HTML with placeholders like {thumbnail}, {pdf_url}, {pdf_title}.

Does it need Ghostscript?

The plugin itself never runs Ghostscript. ImageMagick does, though: it passes PDFs to Ghostscript to read them, so ImageMagick's PDF support only works if Ghostscript is installed on the server. You don't have to check this by hand. The Status tab (Settings > Rapls PDF Image Creator > Status) tells you whether PDFs can be rendered on your server.

My thumbnails are black.

Two causes of black thumbnails have been fixed: PDF/X-1:2001 files (1.0.9), and transparent areas (1.1.0), which are now flattened onto the background colour you choose before the image is saved. If you choose a transparent background with JPEG output, white is used instead, because JPEG cannot store transparency. Thumbnails made before an update are not changed automatically, so regenerate an old black thumbnail before assuming the problem is still there.

Can I change the resolution?

Yes. Settings > Rapls PDF Image Creator > Rendering Resolution sets the DPI the page is rendered at, from 72 to 600 (150 by default). Raising it gives a larger, sharper thumbnail: Max Width and Max Height only scale the rendered page down, never up. Higher values use more memory while the thumbnail is being made.

更新日志:

1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.2 1.3.1 1.3.0 1.2.1 1.2.0 1.1.1 1.1.0 1.0.9.10 1.0.9.9 1.0.9.8 1.0.9.7 1.0.9.6 1.0.9.5 1.0.9.4 1.0.9.3 1.0.9.2 1.0.9 1.0.8 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0