# Wp media regenerate --yes not working for PDF files

**URL:** <https://community.localwp.com/t/wp-media-regenerate-yes-not-working-for-pdf-files/28277>\
**Category:** Support\
**Tags:** wp-cli\
**Created:** [October 14, 2021, 5:32pm UTC](https://community.localwp.com/t/wp-media-regenerate-yes-not-working-for-pdf-files/28277 "2021-10-14T17:32:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [October 14, 2021, 6:13pm UTC](https://community.localwp.com/t/wp-media-regenerate-yes-not-working-for-pdf-files/28277/2 "2021-10-14T18:13:25Z")

</div>

What version of PHP is being used on the site?

I’m not able to generate a preview of a PDF file even in the wp-admin, but I think that’s because of this bug related to Imagick in Local’s PHP lightning services:

> [@Unable to generate PDF thumbnails due to missing Imagick Extension](http://community.localwp.com/t/unable-to-generate-pdf-thumbnails-due-to-missing-imagick-extension/27121):
>
> Thumbnails are not being generated for uploaded PDFs. Attempting to directly create the thumbnail via imagick throws an error. Fatal error: Uncaught ImagickException: PostscriptDelegateFailed [ghostscript library 9.53] -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 ‘-sDEVICE=bmpsep8’ -dTextAlphaBits=4 -dGraphicsAlphaBits=4 ‘-r10x10’ -dFirstPage=1 -dLastPage=1 ‘-sOutputFile=/var/tmp/magick-bCWyxRbUkTq3A8KBgX3pim2c63Xaqn0i%d’ ‘-f/var/tmp/magi…

The confusing part to me is that the error you mention references `ghostscript` which I think Imagick uses if present, so that makes me think that at least some of Imagick is working for you on your machine.

---

_[View the full topic](https://community.localwp.com/t/wp-media-regenerate-yes-not-working-for-pdf-files/28277)._
