DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Show A PDF From PHP

04.29.2006
| 16584 views |
  • submit to reddit
        // Show a PDF from PHP

<?
$pdf = 'archivos/documento.pdf';
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="'.$pdf.'"');
readfile($pdf);
?>