Created
October 5, 2019 15:58
-
-
Save korrio/a898871e5d14dc45d3c5421c0351a307 to your computer and use it in GitHub Desktop.
topdf.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
if($_SESSION['open']) | |
{ | |
header("Content-type:application/pdf"); | |
header("Cache-Control: maxage=1"); | |
header("Pragma: public"); | |
//if(ae_detect_ie()) | |
//{ | |
// It will be called downloaded.pdf | |
header("Content-Disposition:attachment;filename=PrintPDF.pdf"); | |
//} | |
// The PDF source is in original.pdf | |
readfile("ajax/pdftemp.pdf"); | |
session_destroy(); | |
} | |
function ae_detect_ie() | |
{ | |
if (isset($_SERVER['HTTP_USER_AGENT']) && | |
(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) | |
return true; | |
else | |
return false; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment