xiaoanri wrote on Thursday, March 28, 2013:
also, in the fax_dispatch.php file, i found this part to convert tiff file to pdf:
// Create the target PDF. Note that we are relying on the .tif files for
// the individual pages to already exist in the faxcache directory.
//
$info_msg .= mergeTiffs();
// The -j option here requires that libtiff is configured with libjpeg.
// It could be omitted, but the output PDFs would then be quite large.
$tmp0 = exec(“tiff2pdf -j -p letter -o ‘$target’ ‘$faxcache/temp.tif’”, $tmp1, $tmp2);
if ($tmp2) {
$info_msg .= "tiff2pdf returned $tmp2: $tmp0 ";
}
else {
$newid = generate_id();
$fsize = filesize($target);
$catid = (int) $_POST;
// Update the database.
$query = "INSERT INTO documents ( " .
“id, type, size, date, url, mimetype, foreign_id, docdate” .
" ) VALUES ( " .
"’$newid’, ‘file_url’, ‘$fsize’, NOW(), ‘file://$target’, " .
"‘application/pdf’, $patient_id, ‘$docdate’ " .
“)”;
sqlStatement($query);
$query = "INSERT INTO categories_to_documents ( " .
“category_id, document_id” .
" ) VALUES ( " .
"’$catid’, ‘$newid’ " .
if ($tmp2) {
$info_msg .= "tiff2pdf returned $tmp2: $tmp0 ";
}
else {
$newid = generate_id();
$fsize = filesize($target);
$catid = (int) $_POST;
// Update the database.
$query = "INSERT INTO documents ( " .
“id, type, size, date, url, mimetype, foreign_id, docdate” .
" ) VALUES ( " .
"’$newid’, ‘file_url’, ‘$fsize’, NOW(), ‘file://$target’, " .
"‘application/pdf’, $patient_id, ‘$docdate’ " .
“)”;
sqlStatement($query);
$query = "INSERT INTO categories_to_documents ( " .
“category_id, document_id” .
" ) VALUES ( " .
"’$catid’, ‘$newid’ " .
“)”;
sqlStatement($query);
} // end not error
Does this need modification since the file is already pdf format?