summaryrefslogtreecommitdiff
path: root/latex.inc
diff options
context:
space:
mode:
authorSashi202020-08-10 20:06:50 +0530
committerGitHub2020-08-10 20:06:50 +0530
commit8fff84c30a9218ba49877babe4c3fc8e3a7b8d47 (patch)
treec787da0aeefae768b022c7eebede01b1f3d9c9b4 /latex.inc
parent3f7a749f39f656c46e08fef8c001025183af3ae0 (diff)
parent9fdf3f392432e51434566feccc8315c0f1b7c6b6 (diff)
downloadr_textbook_companion-8fff84c30a9218ba49877babe4c3fc8e3a7b8d47.tar.gz
r_textbook_companion-8fff84c30a9218ba49877babe4c3fc8e3a7b8d47.tar.bz2
r_textbook_companion-8fff84c30a9218ba49877babe4c3fc8e3a7b8d47.zip
Merge pull request #40 from Sashi20/drupal_7.x
Modify regenerate pdf function to delete pdf
Diffstat (limited to 'latex.inc')
-rwxr-xr-xlatex.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/latex.inc b/latex.inc
index b5ffebb..832a4b9 100755
--- a/latex.inc
+++ b/latex.inc
@@ -43,7 +43,7 @@ function _latex_generate_files($preference_id, $full_book = FALSE)
del_book_pdf($preference_data->id);
/* check if book already generated */
//var_dump(file_exists($dir_path . "book_" . $preference_data->id . ".pdf"));die;
- if (file_exists($dir_path . "book_" . $preference_data->id . ".pdf"))
+ if (file_exists($dir_path . "book_" . $preference_data->directory_name . ".pdf"))
{
/* download PDF file */
ob_clean();
@@ -54,14 +54,14 @@ function _latex_generate_files($preference_id, $full_book = FALSE)
header("Content-Description: File Transfer");
header('Content-Type: application/pdf');
header('Content-disposition: attachment; filename="' . $preference_data->book . '_' . $preference_data->author . '.pdf"');
- header('Content-Length: ' . filesize($dir_path . "book_" . $preference_data->id . ".pdf"));
+ header('Content-Length: ' . filesize($dir_path . "book_" . $preference_data->directory_name . ".pdf"));
//header("Content-Transfer-Encoding: binary");
//header('Expires: 0');
//header('Pragma: no-cache');
//ob_end_flush();
//ob_clean();
//flush();
- readfile($dir_path . "book_" . $preference_data->id . ".pdf");
+ readfile($dir_path . "book_" . $preference_data->directory_name . ".pdf");
return;
} //file_exists($dir_path . "book_" . $preference_data->id . ".pdf")
$proposal_q = db_query("SELECT * FROM {textbook_companion_proposal} WHERE id = :id", array(