Bonjour,
J'essaie en vain d'utiliser xpdf pour récupérer les donnéesm de mes fichiers pdf pour les indexer mais ça ne fonctionne pas.
Je m'explique, je suis sous Vista pro et j'ai téléchargé la version win32 de xpdf (ftp://ftp.foolabs.com/pub/xpdf/
J'ai copié le fichier téléchargé dans mon répertoire librairie.
Maintenant dans un contrôleur, j'essaie de récupérer les données du fichier celia.pdf pour pouvoir les indexer
Mais l'exec pdfinfo ne fonctionne pas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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]; } }
Est-ce que vous voyez d'où vient l'erreur.
PS: J'utilise le code mis à disposition sur ce site
Merci d'avance pour votre aide!
Partager