Welcome Guest, Not a member yet? Register   Sign In
How to generate file preview using image manipulation class?
#1

I've installed imagick to my php-fpm and I would like to generate a preview image for the uploaded pdf. I discovered this guide:

Image Manipulation Class — CodeIgniter 4.1.1 documentation

but I don't understand how can I generate a preview from a pdf file, I did:

PHP Code:
$image = \Config\Services::image('imagick');
        $image
            
->withFile($path)
            ->fit(10241024'center')
            ->save(ROOTPATH 'public/preview.png'); 

error: file type is not supported. Is there any way to generate a pdf preview as does wordpress? Looking to this thread: Php pdf image preview code - Stack Overflow seems possible using the imagick library
Reply




Theme © iAndrew 2016 - Forum software by © MyBB