2010-05-05 96 views

回答

4

你当然可以打开PDF文件为文本。 PDF文件格式实际上是对象的集合。第一行有一个标题,告诉你版本。然后,您会到底部找到xref表的开始位置的偏移量,该位置表示所有对象的位置。文件中的单个对象(如图形)的内容通常是二进制和压缩的。 1.7规范可以在here找到。

+0

哇,非常感谢您的意见。您是否有过关于PDF和PHP关系的文档? – Kel 2010-05-05 20:38:25

0

谢谢大家的帮助。我欠你这段代码:

// Proceed if file exists 
if(file_exists($sourcePath)){ 
    $pdfFile = fopen($sourcePath,"rb"); 
    $data = fread($pdfFile, filesize($sourcePath)); 
    fclose($pdfFile); 

    // Check if file is encrypted or not 
    if(stripos($data,$searchFor)){ // $searchFor = "/Encrypt" 
     $counterEncrypted++;  
    }else{ 
     $counterNotEncrpyted++; 
    } 
}else{ 
    $counterNotExisting++; 
}