RE: [PHP] PDF Problem
| From: | Benjamin Munoz | Date: | Wed, 22 Nov 2000 01:53:17 +0000 |
| Subject: | RE: [PHP] PDF Problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26554@lists.php.net to get a copy of this message | ||
Try this with the pdf you created:
$fp = fopen("test.pdf","r");
$buff = fread($fp,[file_size here]);
header("Content-Type: application/pdf\n");
echo $buff;
-Ben
-----Original Message-----
From: Uwe Steinmann [mailto:steinm@majestix.fernuni-hagen.de]
Sent: Tuesday, November 21, 2000 1:32 AM
To: Holev`
Cc: php-general@lists.php.net
Subject: Re: [PHP] PDF Problem
On Fri, Nov 17, 2000 at 03:00:31PM +0200, Holev` wrote:
> Hi,
> I downloaded PHP with all the extensions (almost) for win32.
> Now the PDF functions work but when I run a file with PDF functions in it,
> it takes like an hour to load, and I don't even know if it works at the
end
> because I never had the patience to wait for more than that.
>
> why is it taking so long?!
>
> here is one of the codes (from the php manual):
> <?php
> $fd = fopen("test.pdf", "w");
> $pdfdoc = pdf_open($fd);
> pdf_set_info($pdfdoc, "Author", "Uwe Steinmann");
> pdf_set_info($pdfdoc, "Creator", "Uwe Steinmann");
> pdf_set_info($pdfdoc, "Title", "Testing Info Fields");
> pdf_set_info($pdfdoc, "Subject", "Test");
> pdf_set_info($pdfdoc, "Keywords", "Test, Fields");
> pdf_set_info($pdfdoc, "CustomField", "What ever makes sense");
> pdf_begin_page($pdfdoc, 595, 842);
> pdf_end_page($pdfdoc);
> pdf_close($pdfdoc);
> ?>
This code just creates a file, it doesn't send it to the browser.
Uwe
--
Uwe.Steinmann@fernuni-hagen.de
Tel: +2331 987 4528 Fax: +2331 987 375