I run into a problem with my imagick, I use it on my mac with php 5.4. I have installed imagemagick, ghostscript and all thinks via brew.
If I tried to convert a svg file into a pdf with imagick it will raster the text inside the pdf as image. If I use the command line tool convert
everything is fine.
These is my test svg:
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<svg xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:svg='http://www.w3.org/2000/svg' width='396.850393695' height='559.370078732' version='1.1'>
<g id='layer1'>
<text x='15.6' y='44.75' font-size='40' fill='#FF0000'>
<tspan x='15.6' y='44.75'>test</tspan>
</text>
</g>
</svg>
Code: Select all
rsvg-convert -f pdf -o testsvg.pdf test.svg
now I tried it with imagick:
Code: Select all
$svg = "<?xml version='1.0' encoding='UTF-8'?>
<svg xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:svg='http://www.w3.org/2000/svg' width='396.850393695' height='559.370078732' version='1.1'>
<g id='layer1'>
<text x='15.6' y='44.75' font-size='40' fill='#FF0000'>
<tspan x='15.6' y='44.75'>test</tspan>
</text>
</g>
</svg>";
$img = new Imagick();
$img->readimageblob($svg);
$img->setformat('pdf');
$img->writeimage('test.pdf');
Has anyone an idee what happend, or better how can I fix it
Thanks all who give me a moment of his time to read it.
Ben