You have code to execute after filewriting,the output of that code will go as a pdf file continuation. try exit after writing filecontents.
Suhas _________________________________ Encrypt your PHP code for FREE at http://encphp.sspsoft.com _________________________________ ----- Original Message ----- From: "[-^-!-%-" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 03, 2003 2:19 PM Subject: [PHP] PDF on the fly ? > > Hello! > > I'm trying to create a PDF file for downloading, but Acrobat cannot read > the generated file. I get a "file corrupted or cannot be found", whenever > I try to open the file. > > > My script is as follow: > > > header("Cache-control: private"); > header("Content-type: application/octet-stream"); > header("Content-type: application/pdf"); > header("Content-Disposition: attachment; filename=file.pdf"); > > //sql code to retrieve data as $data > > echo $data > > //...more code > > //==================== > > As expected, the server create the pdf file and force the browser to open > the save file dialog box to save the file. Acrobat,however cannot read the > generated file (both online or offline). Any suggestions? > > Am I missing something? > > Please help. > > -john > > =P e p i e D e s i g n s > www.pepiedesigns.com > Providing Solutions That Increase Productivity > > Web Developement. Database. Hosting. Multimedia. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php