From 5d91174391f8b70dc4db45937f4228dfb72fe36e Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Mon, 17 Apr 2006 22:32:14 +0000 Subject: [PATCH] support more document types --- interface/patient_file/report/print_custom_report.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/interface/patient_file/report/print_custom_report.php b/interface/patient_file/report/print_custom_report.php index e92abba86..f91eb2c73 100644 --- a/interface/patient_file/report/print_custom_report.php +++ b/interface/patient_file/report/print_custom_report.php @@ -233,7 +233,21 @@ echo '

'; } else { - echo "NOTE: ".xl('Document')." '" . $fname ."'".xl('cannot be displayed inline becuase its type is not supported by the browser.')."

"; + // echo "NOTE: ".xl('Document')." '" . $fname ."'".xl('cannot be displayed inline becuase its type is not supported by the browser.')."

"; + + // This requires ImageMagick to be installed. + $from_file = $d->get_url_filepath(); + $to_file = substr($from_file, 0, strrpos($from_file, '.')) . '_converted.jpg'; + if (! is_file($to_file)) exec("convert '$from_file' -append '$to_file'"); + if (is_file($to_file)) { + $to_url = $GLOBALS['webroot'] . "/documents/$pid/" . basename($to_file); + echo "

\n"; + } else { + echo "NOTE: " . xl('Document') . "'" . $fname . "' " . + xl('cannot be converted to JPEG. Perhaps ImageMagick is not installed?') . + "

"; + } + } } } -- 2.11.4.GIT