Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I asked my web hosting company to install PDFlib so that I could
create, just very simple dynamic pdfs. (using PHP5)

They said it is installed.  When I call phpinfo(), I see this [which
shows PDFlib as being installed].

Configure Command      './configure'
'--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local'
'--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl'
'--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-ftp'
'--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
'--with-xpm-dir=/usr/X11R6' '--with-iconv'
'--with-imap=/usr/local/imap-2004g' '--with-mcrypt'
'--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr'
'--with-openssl' '--enable-discard-path' '--with-pdflib' '--with-pear'
'--enable-xslt' '--with-xslt-sablot' '--enable-sockets' '--with-ttf'
'--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-zip'

I then get this error each time i try and create the PDF.
Fatal error: Class 'PDFlib' not found in
/home/username/public_html/make_pdf.php on line 9

I have looked everywhere and it seems like I am the only one to get
this error.
Anyone have thoughts or details that may shed light? - thanks

FYI: here is the example that throws the error.
        $p = new PDFlib();

        // open new PDF file; insert a file name to create the PDF on disk
        if ($p->begin_document("", "") == 0) {
            die("Error: " . $p->get_errmsg());

        $p->set_info("Creator", "make_pdf.php");
        $p->set_info("Author", "Me!!!");
        $p->set_info("Title", "Hello world (PHP)!");

        $p->begin_page_ext(595, 842, "");

        $font = $p->load_font("Helvetica-Bold", "winansi", "");

        $p->setfont($font, 24.0);
        $p->set_text_pos(50, 700);
        $p->show("Hello world!");
        $p->continue_text("(says PHP)");


        $buf = $p->get_buffer();
        $len = strlen($buf);

        header("Content-type: application/pdf");
        header("Content-Length: $len");
        header("Content-Disposition: inline; filename=hello.pdf");
        print $buf;
    catch (PDFlibException $e)
        die("PDFlib exception occurred in hello sample:\n" .
        "[" . $e->get_errnum() . "] " . $e->get_apiname() . ": " .
        $e->get_errmsg() . "\n");
    catch (Exception $e)
    $p = 0;  

Site Timeline