• Resolved roberto21

    (@roberto21)


    I don’t know if this plugin is still supported. I have it on a site with shared hosting, and it works fine, I find it extremely useful. However, I have another site with another host, which does not have imagemagick and ghostscript, and obviously the plugin does not work. But I found in this forum a suggestion for a “dirty” solution, modifying two php files in the plugin: but it does not work, it generates empty image thumbnail files.

    In another post in the forum, the author says that this plugin “is no longer necessary since WordPress improved the pdf handling” (from version 4.7??). What does it mean? How can I get the thumbnails from pdf without the plugin? It seems something obvious is eluding me. Can somebody help? Thank you

    Note: I am on wordpres 6.2, the plugin is not tested with this , I know, but in the other installation (6.2 as well) it works flawlessly

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author stianlik

    (@stianlik)

    This plugin use imagemagick to extract the first page of the PDF, if you don’t have imagemagick available, you would have to replace that feature with an implementation in another library (I’m not sure if gd can read PDFs).

    The main feature of this plugin, which is to generate an image of the first page in uploaded PDFs is a builtin feature of WordPress 4.7 (and newer version I assume):

    WordPress 4.7 makes it easier to preview PDFs in the media library by generating image representations of the first page, which are now used throughout the media library and media attachment screens.

    Enhanced PDF Support in WordPress 4.7

    See the comments in that thread for tips on how you can retrieve these thumbnails.

    • This reply was modified 1 year, 4 months ago by stianlik.
    Thread Starter roberto21

    (@roberto21)

    Thank you for your answer. Maybe I am misinterpreting things (I am Italian, so forgive my English), but in the thread you indicated it says that the enhanced wordpress pdf handling also requires ImageMagick and Ghostwriter, so the problem is still there. There must be good reasons why many hosts refuse to implement imagemagick, so the question seems to be: can we get images from pdf WITHOUT using imagemagick/ghostwriter?

    Thanks for your attention.

    Plugin Author stianlik

    (@stianlik)

    In short, no. You need imagick with ghostscript.

    I don’t know the details of the builtin implementation in WordPress, but from what I can glance in the source code it looks like they use imagemagick with ghostwriter as well. To my knowledge, there are not any good alternatives to imagemagick with ghostscript for this feature in PHP.

    Not sure why some hosts won’t enable this extension. It can be measure to avoid expensive computations so that they can serve more customers with less hardware. Or, they just want to keep things simple, less extensions and less libraries on their servers can be a good way to reduce maintenance work and avoid potential security issues.

    You could use exec to call an external program like pdftoppm to create a thumbnail, but that will require the host to have the given program installed. Alternatively, you could send the PDF from your site to a service (some external API) used for extracting a thumbnail (likely more expensive than switching to a more versatile host). However, the most straightforward solution is to use a host where imagick with ghostscript is available.

    Thread Starter roberto21

    (@roberto21)

    Well, we can live without it. The partial solution is to use “pdf embedder” plugins, more convoluted but working to an extent.

    Thanks again for your attention

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin does not work’ is closed to new replies.