Displaying contents of a pdf in php -
this question has answer here:
- read pdf files php 4 answers
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
Post a Comment