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?
ps2pdf (vector to vector)
Re: ps2pdf (vector to vector)
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');
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');
Mikko Koppanen
My blog: http://valokuva.org
My blog: http://valokuva.org
Re: ps2pdf (vector to vector)
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.
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.