• Hi,

    I have a problem with pdf thumbnail generation.
    What puzzles me is my host seems to have all required php modules for it to work,
    I have reset and verified all permissions,
    i have disabled all plugins,
    I tried enabling debugging : no output,
    I even tried to setup a brand new wordpress install, same issue

    I have installed the PDF thumbnails support test plugins:
    ImageMagick: Installed
    Imagick: Installed
    Ghostscript: Installed
    WordPress >= 4.7: Installed

    My wordpress version is 4.9.8

    The PDF is uploaded to the media library, but no thumbnail is generated.
    I get the /wp-includes/images/media/document.png icon instead for all docs.

    I have no idea where to start whatsoever… any help appreciated.

    • This topic was modified 5 years, 5 months ago by o2xav.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter o2xav

    (@o2xav)

    I found a quick workaround by using the GS only pdf preview plugin.

    It accesses ghostscript directly, and it works, but i’m still open for any idea/troubleshooting protocol regarding this issue…

    Thanks

    Hi,

    Exactly the same problem here on several WordPress 4.9.9 and 5.0.2 installations on one server.

    PDF thumbnails support test plugin says everything’s ok:
    https://i.imgur.com/3dPrT44.png

    wp_debug shows no errors

    This little test on command line also works:
    https://stackoverflow.com/questions/2869908/convert-pdf-to-png-using-imagemagick

    Any clues how we could track the reason for such a problem?

    Thanks in advance

    Vipa

    (@vipa)

    I got the same problem.

    I also check these points.

    PDF thumbnails support test plugin says everything’s ok:

    View post on imgur.com

    wp_debug shows no errors

    This little test on command line also works:
    https://stackoverflow.com/questions/2869908/convert-pdf-to-png-using-imagemagick

    The last test failed for me until I changed ImagesMagicks policy.xml to allow pdf.
    After that converting in the console worked, too.
    But there are still no thumbs for pdfs in the wordpress media library.

    Anyone found a solution or has an idea how I could debug this?

    WordPress Version: 5.1.1
    ImageMagick Version: ImageMagick 6.9.7-4 Q16 x86_64
    OS: ‪Ubuntu 18.04.2 LTS‬
    Plesk Onyx: 17.8.11
    • This reply was modified 5 years ago by Vipa.
    • This reply was modified 5 years ago by Vipa.
    • This reply was modified 5 years ago by Vipa.
    Vipa

    (@vipa)

    Ok, changing policy.xml fixed it. All I needed was a restart after the changes.

    Thread Starter o2xav

    (@o2xav)

    @vipa please could you explain in what way you changed this policy file?

    Vipa

    (@vipa)

    Sure,

    locate Imagemagicks policy.xml, in my case it was at:
    /etc/ImageMagick-6/policy.xml

    open the file and locate this line:
    <policy domain="coder" rights="none" pattern="PDF" />

    comment it out, like this:
    <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->

    restart php / your webserver. Done.

    You can read about the policy.xml and the consequences of commenting this out at: https://imagemagick.org/script/security-policy.php

    • This reply was modified 5 years ago by Vipa.
    Thread Starter o2xav

    (@o2xav)

    Thanks, it’s what i figured, will try that later,
    Many thanks again !

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Broken PDF thumbnail generation’ is closed to new replies.