Hi All

I am trying to add PDFlib support to PHP. I have followed all of the instructions but it just wont work.

I am using WinMe, Apache 1.3.23, PHP 4.1.1. I installed apache and PHP using the PHPTriad distribution.

I downloaded the PDFlib files from www.pdflib.com. I placed the "php_pdf.dll" file in the "c:\windows\system\" directory. Yes, I did use the .dll file from the "php4.1.x" folder 🙂

I uncommented the line "extension=php_pdf.dll" in my "php.ini" file. I restarted apache, and PHP doesn't work. If I open "phpinfo.php" I just get a blank screen and my system stops responding properly until I kill the PHP process (using ctrl+alt+del).

I thought is must be something I had done wrong, so I re-commented the line and tried adding a dbx module instead. No problem. I also tried it with another module, also no problem. It appears to just be a problem with PDFlib.

I re-downloaded the module as I thought that might have been the problem, but I get the same result.

Does anyone have any ideas as to what might be wrong?

Many thanks, ben

    Thanks for the link. I am currently playing around with it. Couple of questions though:

    I can't add any images to the pdf. I have been trying to use addJpegFromFile(), as it does not require GD (what the heck is GD?) functionality. however, my outputted pdf just comes up blank.

    I also would like to know how I can make the pdf downloadable as a file. I would like the user to be able to download the file rather than view it through the web browser.

    Thanks in advance, Ben

      both of those issues are addressed in the readme. You should also see the code from the readme, it can anser your questions as well. They all come together in the package.

      the GD Library is a set of tools to manipulate image files. It can be slow, so I think that is why the author of classPDF did not require its use.

        Craig

        I have been over the "readme.pdf" document several times, but I can't find anything that answers why my images wont appear.

        What version are you using? I am using version 009.

        My code looks like this:

        /* Create PDF file */
        include('class.ezpdf.php');
        $pdf =& new Cezpdf();
        
        /* Set title of PDF Document */
        $pdf -> selectFont('./fonts/Helvetica.afm');
        $pdf -> setLineStyle(1, 'round');
        $pdf -> line(30, 760, 550, 760);
        $pdf -> line(30, 820, 550, 820);
        $pdf -> ezText($row['title'], 20, array('justification'=>'center'));
        
        /* Set header image */
        $image = "image.jpg";
        $pdf -> addJpegFromFile($image, 30, 660);
        
        /* Set date of PDF Document */
        $pdf -> ezText(' ', 10, array('justification'=>'left'));
        $pdf -> ezText('Published '.$row['date'], 10, array('justification'=>'center'));
        $pdf -> ezText(' ', 10, array('justification'=>'left'));
        
        /* Set body of PDF document */
        $pdf -> ezText(' ', 10, array('justification'=>'left'));
        $pdf -> selectFont('./fonts/Times-Roman.afm');
        $pdf -> ezText($row['content'], 12, array('justification'=>'left'));
        $pdf -> ezstream();
          Write a Reply...