1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
$indexPath = APPLICATION_PATH."cvtheque/docindex";
$index = Zend_Search_Lucene::open($indexPath);
//Name of the pdf document with out the extension
$pdf_filename = "E:/PortableDrive/App/xampp/htdocs/pagesinterim.com/trunk/Sources/public/cvtheque/celia";
// get pdf information
$pdftotextpath= "E:/PortableDrive/App/xampp/htdocs/pagesinterim.com/trunk/Sources/library/xpdf/pdftotext.exe";
$output=$pdftotextpath."(".$pdf_filename.".pdf)";
//$output = exec("pdfinfo ".$pdf_filename.".pdf");
//Gets the metadata
$data = explode("\n", $output); //puts it into an array
print_r($data);
exit;
//Get the metadata that we need from the PDF.
//Parse through the Array and store in variables. */
for($c=0; $c < count($data); $c++) {
//Number of Pages
if(stristr($data[$c],"pages") == true) {
$pagestr = $data[$c];
echo $pagestr;
}
//Author
if(stristr($data[$c],"author") == true) {
$authorstr = $data[$c];
echo $authorstr;
}
//Title
if(stristr($data[$c],"title") == true) {
$titlestr = $data[$c];
}
//Modification Date
if(stristr($data[$c],"ModDate") == true) {
$moddatestr = $data[$c];
}
//File Size
if(stristr($data[$c],"File size") == true) {
$sizestr = $data[$c];
}
} |