Re: PDFlib on PHP4
| From: | Alain Samoun | Date: | Wed, 08 Aug 2001 23:38:32 +0000 |
| Subject: | Re: PDFlib on PHP4 | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-8725@lists.php.net to get a copy of this message | ||
Your very first line on your script should be the
header: header("Content-Type: application/pdf");
You can also use ob_start(), but it seems to work only with Netscape for me(?)
Alain
On Wed, Aug 08, 2001 at 07:25:32PM -0400, Adam Oliver wrote:
> I'm getting this message
> <snip>
>
> Warning: Cannot add header information - headers already sent by (output
> started at c:\program files\apache group\apache\htdocs\test\pdftest.php:2)
> in c:\program files\apache group\apache\htdocs\test\pdftest.php on line 3
>
> Warning: Cannot add header information - headers already sent by (output
> started at c:\program files\apache group\apache\htdocs\test\pdftest.php:2)
> in c:\program files\apache group\apache\htdocs\test\pdftest.php on line 26
>
> </snip>
>
> with the following code.
>
> <snip>
> <?php
> $len = filesize($filename);
> header("Content-type: application/pdf");
> header("Content-Length: $len");
> header("Content-Disposition: inline; filename=foo.pdf");
> readfile($filename);
> ?>
> </snip>
>
> The server is Apache for Win32. Any idea on how to fix it?
>
> Adam
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net