4 * FusionForge document search engine
6 * Copyright 2005, Fabio Bertagnin
7 * Copyright 2009-2011, Franck Villaume - Capgemini
8 * http://fusionforge.org
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require dirname(__FILE__).'/../../include/env.inc.php';
28 require_once $gfcommon.'docman/engine/parser_text.inc.php';
32 echo "Usage : parser_pdf.php <filename>\n";
37 if (!is_file($fichin))
40 $fichout = tempnam(forge_get_config('data_path'),"tmp");
41 $cmd = "/usr/bin/pdftotext $fichin $fichout";
42 $res = shell_exec($cmd);
44 echo parser_text($fichout);
49 // c-file-style: "bsd"