Displaying contents of a pdf in php -


this question has answer here:

when echoing out file_get_contents on uploaded pdf file, load of nonsense displayed so:

6}ÕìúÖ

is there anyway of decoding infomation?

this code maybe you

<?php  $file = 'path/to/pdf/file.pdf';  $filename = 'filename.pdf';  header('content-type: application/pdf');  header('content-disposition: inline; filename="' . $filename . '"');  header('content-transfer-encoding: binary');  header('accept-ranges: bytes');  @readfile($file); 

?>

be successfull


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -