WordPress.org

Plugin Directory

Test out the new Plugin Directory and let us know what you think.

PDF Image Generator

Generate automatically cover image of PDF by using ImageMagick. Allow user to insert PDF link with thumbnail into editor and set as Featured Image.

By uploading a PDF attachment, this plugin convert the cover page to jpeg and attach it as a post thumbnail file. It also allows displaying a thumbnail icon and inserting PDF link with a cover image into the editor.

Available only for WordPress 4.0+, also only on the server which ImageMagick and GhostScript are installed.

This plugin hooks to the media editor and generates the first page image of PDF by using ImageMagick with GhostScript. It requires no setup, just activate the plugin via the admin install page. Allow to set a PDF as an image.

How it works

This Plugin replaces and extends the following features.

  • Generate cover image of PDF by using ImageMagick. Generated Image has different size variations and is attached to PDF.
  • Register Generated Image as Featured Image (post-thumbnail) of PDF.
  • Display Generated Image as icon instead of Mime-type Icon in Admin Page.
  • Hide Generated Image file itself in Media Library. (v1.2 or later)
  • Replace link text with JPG when inserting PDF to Text Editor.
  • Delete Generated Image when deleting PDF from Media Library.
  • Allow to manage and output Generated Image and PDF on manually in template file. (see Other Notes.)
  • Allow to set PDF as Featured Image and to use functions in the same way as image file. (v1.2 or later, see Other Notes.)
  • Allow to control maximum size of Generated Image and other default settings in Plugin Page. (v1.3.4 or later)

Generated Items

A generated image file is registered as post children of a PDF file and it has different size variations. Files build a tree like below.

  • my-file.pdf (Your PDF)
    • my-file-pdf.jpg (Generated Cover Image of Your PDF)
      • my-file-pdf-1024x768.jpg (Large Size)
      • my-file-pdf-300x225.jpg (Medium Size)
      • my-file-pdf-150x150.jpg (Thumbnail size)
      • ...(And Your Custom File Sizes)

Insert HTML into the editor

Select a PDF file in the Media Uploader and insert it into the the editor. An output HTML is automatically rewritten like below.

<a class="link-to-pdf" title="dummy-pdf" href="http://exmaple.com/wp-content/uploads/2015/01/dummy-pdf.pdf" target="_blank"><img width="227" height="320" class="size-medium wp-image-9999 thumb-of-pdf" src="http://exmaple.com/wp-content/uploads/2015/01/dummy-pdf-pdf-227x320.jpg" alt="thumbnail-of-dummy-pdf" /></a>

*If you are using a document viewer plugin (like GDE) and want insert html which is made by it, select "Default (Title)" of "media" selector.

Requires: 4.0 or higher
Compatible up to: 4.7.2
Last Updated: 2 weeks ago
Active Installs: 7,000+

Ratings

4.7 out of 5 stars

Support

0 of 8 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0
50,2,1
100,1,1
100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1
100,1,1 100,1,1
100,1,1
100,1,1 100,2,2 100,1,1
100,1,1
100,1,1 100,1,1