Re: help with PDF - undefined function
| From: | Tim McGuire | Date: | Wed, 03 Jan 2001 19:34:37 +0000 |
| Subject: | Re: help with PDF - undefined function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-32536@lists.php.net to get a copy of this message | ||
This is a repost of a message that appeared in the pdflib mail list:
I had a similar problem last night. The pdf and perhaps some other
libraries weren't registered with the O/S. Running "ldconfig" will
force the O/S to rebuild the table of libraries in its cache. You may
have to edit your /etc/ld.so.conf file to include /usr/local/lib (or
whereever you put the libs).
Or you can always reboot!!!
HTH,
Paul
--- In pdflib@egroups.com, scott@d... wrote:
> I am getting undefined function errors when using Pdf functions in
> PHP 4. Here what I done to compile!
>
> Configured, compiled and installed pdflib-3.0.2 with:-
>
> ./configure --enable-cxx --enable-shared --enable-static --enable-
> shared-pdflib
> make
> make test
> make install
>
> and the libraries where installed to /usr/local/lib
>
> Created symlinks
> ln -s /usr/lib/libtiff.so.3.5.4 /usr/lib/libtiff.so
> ln -s /usr/lib/libjpeg.so.62.0.0 /usr/lib/libjpeg.so
>
>
> Configured, compiled and installed PHP Version 4.0.3pl1 with:-
> ./configure --with-mysql --enable-track-vars --with-zlib-dir --with-
> jpeg-dir=/usr/local/lib --with-png-dir=/usr/lib --with-tiff-
> dir=/usr/local/lib --with-pdflib=/usr/local/lib --with-
> apache=../apache_1.3.12/.
> make
> make install
>
>
> Then configured and made apache as normal. On running a test.php
> script which runs php_info();
> The configure command shown was correct
> ./configure' '--with-mysql' '--enable-track-vars'
> '--with-zlib-dir'
> '--with-jpeg-dir=/usr/local/lib' '--with-png-dir=/usr/lib' '--with-
> tiff-dir=/usr/local/lib' '--with-pdflib=/usr/local/lib' '--with-
> apache=../apache_1.3.12/.'
>
> which is correct!
>
> But when I try to create a pdf I get :-
> Fatal error: Call to undefined function: pdf_open() in pdf.php on
> line 3
>
> Which suggests that pdf did not get compiled in!
>
> Any suggestions would be appreciated!
>>> "Jon Rosenberg" <php@columbusinteractive.com> 01/03/01 12:42PM
>>> >>>
I am trying to get his sample code from the php manual to work:
I get the following error:
Fatal error: Call to undefined function: pdf_open() in
/home/sites/site5/web/pdf.php on line 3
pdf_open() is a built-in function of PHP, so I'm not sure why this isn't
working. I'm using pdflib 3.03 and PHP 4.0.3pl1 on linux. Any ideas?
I can see that it is indeed making the file in the directory, but why is
this function 'undefined'?
Jon
From the manual:
Most of the functions are fairly easy to use. The most difficult part is
probably to create a very simple pdf document at all. The following example
should help to get started. It creates the file test.pdf with one page. The
page contains the text "Times Roman outlined" in an outlined, 30pt font. The
text is also underlined.
<?php
$fp = fopen("test.pdf", "w");
$pdf = pdf_open($fp);
pdf_set_info($pdf, "Author", "Uwe Steinmann");
pdf_set_info($pdf, "Title", "Test for PHP wrapper of PDFlib 2.0");
pdf_set_info($pdf, "Creator", "See Author");
pdf_set_info($pdf, "Subject", "Testing");
pdf_begin_page($pdf, 595, 842);
pdf_add_outline($pdf, "Page 1");
pdf_set_font($pdf, "Times-Roman", 30, "host");
pdf_set_value($pdf, "textrendering", 1);
pdf_show_xy($pdf, "Times Roman outlined", 50, 750);
pdf_moveto($pdf, 50, 740);
pdf_lineto($pdf, 330, 740);
pdf_stroke($pdf);
pdf_end_page($pdf);
pdf_close($pdf);
fclose($fp);
echo "<A HREF=getpdf.php>finished</A>";
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net