|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-04-04 10:41 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 16:00:01 2025 UTC |
If I create a test.php file with the following code, I put that test.php on the website. the code will show the pdf on the screen. It works ok. <?php header("Content-Type: application/pdf"); @readfile($pdfFile); ?> But if I put these few lines of code in my php, it does not show the pdf file on the screen. <?php $pdffile = myCreatePDF_function($myHTML); //I know my pdf file is created, because if I stop here, I can see my pdf file and I can use my test.php to show my pdf file on screen. //But if I put the code in here. It does not work. header("Content-Type: application/pdf"); @readfile($pdfFile); exit(); ?> Can anyone tell me why? Any comments are highly appreciated. Cindy