Re: PDF on the fly ?
| From: | Suhas Pharkute | Date: | Fri, 04 Jul 2003 01:37:28 +0000 |
| Subject: | Re: PDF on the fly ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153946@lists.php.net to get a copy of this message | ||
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: "[-^-!-%-" <monfort@engineering.sdsu.edu>
To: <php-general@lists.php.net>
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
>