added general-purpose fax support
[openemr.git] / interface / fax / fax_view.php
blobfcb0b19bdc37e30833e93300475c81609b750ed6
1 <?php
2 // Copyright (C) 2006 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 require_once("../globals.php");
11 $ffname = $GLOBALS['hylafax_basedir'] . '/recvq/' . $_GET['file'];
13 if (!file_exists($ffname)) {
14 die(xl("Cannot access ") . $ffname);
17 ob_start();
19 passthru("tiff2pdf $ffname");
21 header("Pragma: public");
22 header("Expires: 0");
23 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
24 header("Content-Type: application/pdf");
25 header("Content-Length: " . ob_get_length());
26 header("Content-Disposition: inline; filename=" . basename($ffname, '.tif') . '.pdf');
28 ob_end_flush();
30 exit;