}
if (is_null($book)) {
- return;
+ return false;
}
// Normalize range
$baseDocument = $this->getPDFComplexBaseDocument($book);
if (!file_exists($baseDocument)) {
- return;
+ return false;
}
if (!count($range)) {
- return;
+ return false;
}
switch ($book->parametres->bookmarkUsePDF) {
case 'download':
- return WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfName;
+ return WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfReplace;
break;
case 'thumbnails':
return WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfThumbnails;
$dest = $this->getPDFComplex($book, $this->args['range']);
+ if ($dest === false) {
+ http_response_code(404);
+ exit;
+ }
+
if (!$print) {
// Return the url of the resulting pdf
http::redirect($dest['url']);