Kam Paul
Kam Paul

Reputation: 111

Convert JPG,GIF,EPS and PDF to PDF with Imagemagick in PHP

I need to convert jpg,gif and eps files to pdf and vice versa. Is ImageMagick will be the best tool for this ? I have configure imagemagic with ubuntu 11.04 and using CLI trying to convert images into pdf, but quality is too bad. So what whoud be best approch to convertion ?

Thanks in Advance :)

Upvotes: 2

Views: 1301

Answers (1)

Patrice Levesque
Patrice Levesque

Reputation: 2114

You want to support two types of files; raster (jpg/gif) and vectorial (eps). Conversion from one set to the other is never lossless.

When converting from vectorial to raster or vice-versa, one crucial parameter is -density, that sets the image size before it gets converted.

Imagemagick is probably the right tool for vectorial to raster, it's just a matter of getting the parameters right. To transform raster to vectorial, better tools would probably be autotrace or potrace, but be aware these tools cannot do a perfect conversion.

Upvotes: 1

Related Questions