Page 1 of 1
ps2pdf (vector to vector)
Posted: 2009-02-23T06:55:02-07:00
by macmagick
Is ist possible to configure the delegates.xml so that an eps as input is not beeing rasterized while beeing converted to pdf (or eps again).
I can convert my eps to pdf as root in my shell using ps2pdf – and everything is perfect. How to do the same from within Imagick or PHP?
Re: ps2pdf (vector to vector)
Posted: 2009-02-24T02:40:11-07:00
by mkoppanen
Hi,
you can add new delegates into the delegates.xml file. You can read using the delegate using:
$im->newPseudoImage(100,100, 'xyz:file.jpg');
and writing
$im->writeImage('xyz:file.jpg');
Re: ps2pdf (vector to vector)
Posted: 2009-02-24T07:19:30-07:00
by macmagick
That makes some things clear. By using readImageBlob() the eps is beeing rasterized already?
There's nothing like a newPseudoImageBlob()? Actually my input is pure postscript (from a variable). Do I have to write the variable down by like tempnam() and writing/reading through a handle etc? I configured <delegate decode="eps" encode="pdf" ...> to use ps2pdf and did the following:
- tempfile $temp by tempnam()
- fwrite my var (postscript as string) into $temp
- $im->newPseudoImage(100,100,"eps:".$temp);
- $im->writeImage("pdf:mypdf.pdf")
The resulting mypdf.pdf is rasterized!
I tried the same with eps2ps: there I got my eps in the left down corner on a A4 page: just telling you this for it shows the delegates are beeing used – sort of?
My delegation: <delegate decode="eps" encode="pdf" mode="bi" command=""/usr/local/bin/ps2pdf" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i""/>
And still: I'd prefer not to write any tempfiles by myself.