diff options
author | Sashi20 | 2020-08-10 20:06:50 +0530 |
---|---|---|
committer | GitHub | 2020-08-10 20:06:50 +0530 |
commit | 8fff84c30a9218ba49877babe4c3fc8e3a7b8d47 (patch) | |
tree | c787da0aeefae768b022c7eebede01b1f3d9c9b4 /latex.inc | |
parent | 3f7a749f39f656c46e08fef8c001025183af3ae0 (diff) | |
parent | 9fdf3f392432e51434566feccc8315c0f1b7c6b6 (diff) | |
download | r_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-x | latex.inc | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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( |