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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -