检查文件是否包含栅格或矢量元素? (pdf,eps,ai) [英] Check if a file contains raster or vector elements? (pdf, eps, ai)

查看:88
本文介绍了检查文件是否包含栅格或矢量元素? (pdf,eps,ai)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以检查文件中是否包含栅格元素?我希望对.pdf,.eps和.ai格式执行此操作.

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.

如果文件只是矢量,我会将其转换为.svg,如果它具有某些光栅元素,则必须将其转换为.png文件.

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.

我正在使用PHP,但是我也可以利用任何命令行工具.例如,我正在考虑使用Inkscape进行实际的转换.

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.

推荐答案

没有.

以下是eps的理论计算机科学证明,证明不能计算出所要属性.

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

PostScript(ps)和封装的PostScript(eps)正在使用完整的编程语言.在理论计算机科学中,存在证明无法计算以完全语言编写的程序的某些属性的证据.这样的属性例如是给定程序是否终止.因此,我们知道存在一个PostScript程序,在其中我们无法确定它是否终止.如果我们采用本程序,则从其中删除所有光栅对象,并仅插入一个光栅对象,该光栅对象仅在程序终止时才会打印在文档上.为此,我们在每个程序部分的最后一步插入了此光栅打印步骤,这可能导致终止(直接在每个quit命令之前(如果存在这样的命令)以及在main的末尾).现在,我们有了一个PostScript程序,我们无法确定该程序是否包括打印光栅对象.确实不能说出来,因为如果我们知道它是否包括打印它,我们也知道它是否终止并且我们已经知道,我们就无法计算该属性. q.e.d.

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.

这篇关于检查文件是否包含栅格或矢量元素? (pdf,eps,ai)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆