include_once 'data.php'; include_once 'functions.php'; include_once 'pdfclass.php'; session_write_close(); // Sanitize PDF filename. $file = ''; if (!empty($_GET['file'])) { $file = preg_replace('/[^a-zA-z0-9\\_\\.pdf]/', '', $_GET['file']); } else { displayError("No PDF provided."); } // Start the PDFViewer class. $pdfHandler = new PDFViewer($file); // Get page number and sizes. $page_info = $pdfHandler->getPageInfo(); $page_number = $page_info['page_number']; $page_sizes = $page_info['page_sizes']; // Initial page number. $page = $pdfHandler->getInitialPageNumber(); // Image resolutions in PPI. $thumb_res = $pdfHandler->thumb_resolution; $page_res = $pdfHandler->page_resolution; // Display PDF file. if (!isset($_GET['inline'])) { ?> <!DOCTYPE html> <html style="width:100%;height:100%"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">