EPS Vector in - EPS Vector out?
Posted: 2007-11-14T10:27:11-07:00
With MagickWand for PHP, is it possible to read in a vector based EPS file (created in Adobe Illustrator), add some text to the image, and then output the whole thing in vector format?
I'm struggling to get my head around the techniques involved and am trying to adapt the original MagickWand example. Here's the code I have so far:
This works, but produces a non-vector image which looks much like a low quality JPEG/GIF. Can anyone help or point me in the right direction?
Thanks in advance.
I'm struggling to get my head around the techniques involved and am trying to adapt the original MagickWand example. Here's the code I have so far:
Code: Select all
<?php
$font_file = '100.ttf';
$photo_file = 'test.eps';
$magick_wand=NewMagickWand();
MagickSetFormat($magick_wand, 'eps');
MagickReadImage($magick_wand,$photo_file);
$drawing_wand=NewDrawingWand();
DrawSetFont($drawing_wand,"$font_file");
DrawSetFontSize($drawing_wand,100);
DrawSetGravity($drawing_wand,MW_CenterGravity);
$pixel_wand=NewPixelWand();
PixelSetColor($pixel_wand,"#c0c0c0");
DrawSetFillColor($drawing_wand,$pixel_wand);
if (!IsDrawingWand($drawing_wand)) echo "\$drawing_wand is not a DrawingWand resource";
if (MagickAnnotateImage($magick_wand,$drawing_wand,0,0,0,"Rose") != 0) {
header('Content-type: image/eps');
header('Content-Disposition: attachment; filename="vector_test.eps"');
MagickEchoImageBlob( $magick_wand );
} else {
echo "Exception: " . MagickGetExceptionString($magick_wand);
}
?>
Thanks in advance.