Generate SVG Image using svg raw data in imagick php
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to create svg image using svg raw data which i am getting from fabric js. I have used below code to generate the svg using svg raw data but its not working properly. public function generate_svg($raw_svg='',$prefix='',$folder_name='card_image') { $file_name = ''; if($raw_svg!='') { try{ $file_name = uniqid($prefix).".svg"; $image = new \Imagick(); $image->readImageBlob($raw_svg); $image->setImageFormat("svg"); $image->writeImage($folder_name.$file_name); } catch (ImagickException $ex) { echo $ex->getMessage(); } } return $file