Is there a way to convert WMF to PNG using imagick in PHP so that the Cyrillic alphabet in the WMF image is converted to Cyrillic in PNG without error

107 views Asked by At

I am trying to create PNG images from WMF to view such files in a browser. WMF is a drawing of a part with a description table and text in Cyrillic. I'm doing this in PHP using imagick:

$image = new Imagick();
$image->readImage("01257.wmf");
$image->writeImage("01257_new.png");
$image->clear();
$image->destroy();

I get an excellent result, but Cyrillic characters turn into a set of incomprehensible characters.

As I wrote above. I tried imagick in PHP. I also tried to convert to other formats: JPG, TIFF. I didn't get a result. There was an idea to transfer WMF to CANVAS, and then save it to PNG, but I did not find how to do it without errors.

I studied the PHP imagick manual (https://www.php.net/manual/ru/book.imagick.php), I didn't find a solution, maybe I don't know something about text encoding!?

*Project on Ubuntu 22, nginx

0

There are 0 answers