Reply to PDFlib

Your name:

Reply:


Posted by Jeff_M on 12/12/06 03:00

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;
?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация