0
A
回答
4
你当然可以打开PDF文件为文本。 PDF文件格式实际上是对象的集合。第一行有一个标题,告诉你版本。然后,您会到底部找到xref表的开始位置的偏移量,该位置表示所有对象的位置。文件中的单个对象(如图形)的内容通常是二进制和压缩的。 1.7规范可以在here找到。
1
0
您不能仅仅打开该文件,因为它是用于创建PDF显示的对象的二进制转储,包括编码,字体,文本,图像。我写了一篇博文,解释文本如何存储在http://pdf.jpedal.org/java-pdf-blog/bid/27187/Understanding-the-PDF-file-format-text-streams
+0
arigato gozaimasu! – Kel 2010-05-06 16:01:40
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++;
}
哇,非常感谢您的意见。您是否有过关于PDF和PHP关系的文档? – Kel 2010-05-05 20:38:25