470,833 Members | 1,317 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

PDFlib

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'
'--with-zlib'

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.
<?php
try
{
$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)");
$p->end_page_ext("");

$p->end_document("");

$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)
{
die($e);
}
$p = 0;
?>

Dec 12 '06 #1
0 3438

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Randell D. | last post: by
2 posts views Thread by bonehead | last post: by
reply views Thread by William Holroyd | last post: by
reply views Thread by ian douglas | last post: by
reply views Thread by acorn71 | last post: by
reply views Thread by Rul | last post: by
2 posts views Thread by Nader Emami | last post: by
reply views Thread by seth.northrop | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.