Pregunta

If not, do you think it would take an arm and a leg to create such a class?

¿Fue útil?

Solución

I would start by taking a look at the PHP Imagick library, and installing that.

In Unix, a command such as convert file.ai output.eps should work, so you should be able to run the conversion using the PHP version of the ImageMagick library (the convert utilities in Unix are backed by the same library).

And indeed, a snippet such as:

$im = new Imagick('image.ai');
$im->setImageFormat('eps');
$im->writeImage('image.eps');

should do the trick.

Note: in case the resulting image contains artifacts of any kind, make sure you read the PHP documentation for extra parameters that might need to be specified. As an example - when converting to PNG to JPG, you need to specify a background color for the new JPG image and then you also need to flatten the image in order to get the output. I am not very familiar with the EPS and AI formats, which is why I can't give you any relatively accurate pointers.

Edit:

Here's another question with a similar task that has a great answer which suggests that .ai files should work with Imagick.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top