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