Re: PDF pain

From: Date: Fri, 19 Jul 2002 13:57:56 +0000
Subject: Re: PDF pain
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-108501@lists.php.net to get a copy of this message
On Friday 19 July 2002 21:54, Michael Hall wrote: > 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 I think you want the name to be 'pdftest.php'. Try it and see what you get. > 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" That's because your 'pdf' file is in actual fact a raw php file. > So it looks like a header problem or something? No. > This raises a few other questions: > > - Should the PHP script be called pdftest.php or pdftest.pdf? The former. > - Does httpd.conf need an AddType directive for pdf files? I've tried a > few variations on "AddType application/x-pdf .pdf" etc No. > - Should .pdf be added to the php AddType directive? > eg. "AddType application/x-httpd-php .php .htm .pdf No. > Basically, I'm confused. Anyone been there done that? Yes. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* I've got an IDEA!! Why don't I STARE at you so HARD, you forget your SOCIAL SECURITY NUMBER!! */

« previous php.general (#108501) next »