From 20c489450e88230371fd0cfd376d6c4bd5a14cd4 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 24 Jun 2019 16:57:03 +0200 Subject: [PATCH] Improve : depending if pdftk is a snap or not , his path must be a setting --- include/config.inc.example | 6 +++++- include/constant.php | 2 +- include/lib/config_file.php | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/config.inc.example b/include/config.inc.example index 584dd211c..d3024056c 100644 --- a/include/config.inc.example +++ b/include/config.inc.example @@ -63,4 +63,8 @@ define ("dbname",""); // you can uncomment this // after replace NOALYSS_HOME by the path of the local installation of Noalyss // ini_alter("open_basedir", "/usr/bin:/tmp/:NOALYSS_HOME"); - \ No newline at end of file + +// In recent distribution linux, pdftk is a snap, you should set the path +// for exporting document in PDF +// $pdftk = /usr/bin/pdftk +// $pdftk = /snap/bin/pdftk diff --git a/include/constant.php b/include/constant.php index a5f2119a1..748d26496 100644 --- a/include/constant.php +++ b/include/constant.php @@ -271,7 +271,7 @@ if ( ! file_exists($ps2pdf) ) /** * Outil pour manipuler les PDF */ -$pdftk='/snap/bin/pdftk'; +if ( ! isset ($pdftk)) { $pdftk ='/usr/bin/pdftk'; } if (file_exists($pdftk)) { define ('PDFTK',$pdftk); diff --git a/include/lib/config_file.php b/include/lib/config_file.php index 3074fbddb..fcdb6021d 100644 --- a/include/lib/config_file.php +++ b/include/lib/config_file.php @@ -227,7 +227,10 @@ function display_file_config($p_array,$from_setup=1,$p_os=1) print ("// define ('OVERRIDE_PARAM',1);\r\n"); print ("// ini_set ('max_execution_time',240);\r\n"); print ("// ini_set ('memory_limit','256M');\r\n"); -// + print ("// In recent distribution linux, pdftk is a snap, you should set the path\r\n"); + print ("// for exporting document in PDF\r\n"); + print ("// \$pdftk = /usr/bin/pdftk \r\n"); + print ("// \$pdftk = /snap/bin/pdftk \r\n"); } /*!\brief create the config file