Check if a file contains raster or vector elements? (pdf, eps, ai)

烈酒焚心 提交于 2019-12-04 10:47:05

No there is not.

The following is a theoretical computer science proof for eps which proofs, that the asked property can not be computed.

PostScript(ps) and also Encapsulated PostScript(eps) are turing complete programming language. In Theoretical Computer Science there exists proofs which say that certain properties of programs written in turing complete languages can not be computed. Such a property is for example, whether a given program ever terminates. So we know that there exists a PostScript Program where we can not tell whether it terminates. If we take this Program remove all raster objects from it and insert only a single raster object which will only be printed on the document if and only if the program terminates. We do this by inserting this raster printing step as last step on every program part which could lead to termination (directly before every quit command (if such a command exists) and at the end of the main). Now we have a PostScript Program for which we can not tell whether it includes printing a raster object or not. It indeed can not be told, since if we knew whether it does include printing it we also know whether it terminates and we already know, that we can not compute this property. q.e.d.

You could run this command on pdf files and check if anything raster exists on the file:

  grep -c -i "/image" thisfile.pdf

You can search for DeviceRGB in EPS/AI files

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!