PDF pain
| From: | Michael Hall | Date: | Fri, 19 Jul 2002 13:54:48 +0000 |
| Subject: | PDF pain | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108498@lists.php.net to get a copy of this message | ||
I THINK I have installed pdflib and compiled it into PHP 4.2.1 OK.
At least, configure/make/make install all went OK and it is trying to
work.
I copied the sample 'Hello World in PDF' script out of Programming PHP (p
234) into a file named pdftest.pdf
When I try to access http://localhost/pdftest.pdf,
Konqueror tries to open
a PDF file but then spits the dummy saying:
"Could not open file
blahblah.pdf which has type application/x-zerosize. KGhostview can only
open Postscript and Portable Document Format files"
So it looks like a header problem or something?
This raises a few other questions:
- Should the PHP script be called pdftest.php or pdftest.pdf?
- Does httpd.conf need an AddType directive for pdf files? I've tried a
few variations on "AddType application/x-pdf .pdf" etc
- Should .pdf be added to the php AddType directive?
eg. "AddType application/x-httpd-php .php .htm .pdf
Basically, I'm confused. Anyone been there done that?
TIA
Michael