Is there a way to check if a file has raster elements in it? I would be interested to do this for the .pdf, .eps and .ai formats.
If the file is only vector I am converting it to .svg and if it has some raster elements I have to convert it to .png file.
I am working in PHP but I can utilize any command line tools as well. For instance I am considering using Inkscape to do the actual conversion.
You could run this command on pdf files and check if anything raster exists on the file:
grep -c -i "/image" thisfile.pdf
You could convert the image to EPS format, and search if "/ImageType" exists. The "/ImageType" means the following object is a raster image. If it doesn't exist in the whole EPS file, this EPS is a vector file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With