Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use imagemagick with tcpdf

I need to handle images in TCPDF

I get this error.. Imagemagick is installed, but how do I tell TCPDF the path to imagemagick?

TCPDF ERROR: TCPDF requires the Imagick or GD extension to handle PNG images with alpha channel.
like image 627
clarkk Avatar asked Aug 20 '12 18:08

clarkk


2 Answers

Just try by installing missing GD extension before you do anything else.

PHP 5

sudo apt-get install php5-gd

PHP 7.1

sudo apt install php7.1-gd

PHP 7.2

sudo apt install php7.2-gd

PHP 7.3

sudo apt install php7.3-gd

And then Restart Apache/NGINX

#Apcahe
sudo service apache2 restart
#NGINX
service nginx restart
like image 163
M_R_K Avatar answered Sep 17 '22 14:09

M_R_K


You need to enable the GD or ImageMagick extensions for PHP (either one or the other will do). If you choose ImageMagick you need to make sure you have the packages installed.

Edit your php.ini file to enable the extension. On Windows:

extension=php_imagick.dll

or

extension=php_gd2.dll

On Unix/Linux:

extension=imagick.so

or make sure you have PHP compiled with the --with-gd option or install the php5-gd package. (For some distributions it may be called something like php54w-gd)

like image 44
davidethell Avatar answered Sep 16 '22 14:09

davidethell