Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: jeppefugl on March 14, 2007, 10:19:32 PM

Title: PHP pdflib
Post by: jeppefugl on March 14, 2007, 10:19:32 PM
Hi everybody

I am looking for a way to install pdflib for php on SME 7.1.2.

I have been looking in the forum and on the internet, but nothing seems to work for me.

Can anybody help me with that?


Best Regards,

Jeppe
Title: PHP pdflib
Post by: Confucius on March 14, 2007, 10:55:56 PM
No matter what PHP version I have I always can get away with another solution. Might be that ezPDF or FPDF might be a solution for you aswell.

Harro
Title: PHP pdflib
Post by: jeppefugl on March 15, 2007, 08:44:19 AM
Ok, I did not know about these solutions, but I will try that.

The most important thing for me is to create pdf's  :D

Thanks a lot.
Title: Re: PHP pdflib
Post by: edb on February 29, 2008, 06:56:45 PM
Hi everybody

I am looking for a way to install pdflib for php on SME 7.1.2.

I have been looking in the forum and on the internet, but nothing seems to work for me.

Can anybody help me with that?


Best Regards,

Jeppe

jeppe

Did you ever find a way or someone to supply the rpms to install pdflib and the PECL php extention?

I would even consider paying someone to provide me with the two rpms (PDFLIB library & the php plugin) for SME 7.3

edb
Title: Re: PHP pdflib
Post by: ergozd on February 29, 2008, 10:27:03 PM
Hi edb!

pdflib for RHEL4
http://rpms.5dollarwhitebox.org/clean/php-pdflib/rhel4/DEPS/pdflib-6.0.1-1.2.el4.rf.i386.rpm
http://rpms.5dollarwhitebox.org/clean/php-pdflib/rhel4/DEPS/pdflib-devel-6.0.1-1.2.el4.rf.i386.rpm

pdflib-pecl
http://dag.wieers.com/rpm/packages/php-pecl-pdflib/

I did use DAG's src.rpm and re-built (OBS!!! No warranties, install it AT YOUR OWN RISK)
http://ergin.dyndns.org/download/sme7_contribs/experimental/php-pecl-pdflib-2.1.4-1eo.i386.rpm

Good luck
Title: Re: PHP pdflib
Post by: edb on February 29, 2008, 10:41:52 PM
Thanks ergozd

Do I need to install both of the pdflib rpms followed by the php-pecl?
And was this for SME 7.3?

edb
Title: Re: PHP pdflib
Post by: edb on March 01, 2008, 12:18:52 AM
I get the following error when I try to install the devel rpm with yum localinstall however, the others rpms installed fine and PHP see pdflib as being installed and version 6.
Any suggestions on the devel rpm error and BTW thanks again for your help here ergozd.

Examining pdflib-devel-6.0.1-1.2.el4.rf.i386.rpm: pdflib-devel - 6.0.1-1.2.el4.r
f.i386
Marking pdflib-devel-6.0.1-1.2.el4.rf.i386.rpm to be installed
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package pdflib-devel.i386 0:6.0.1-1.2.el4.rf set to be updated
--> Running transaction check
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Excluding Packages from CentOS - updates
Finished
Excluding Packages from CentOS - updates
Finished
--> Processing Dependency: libpng-devel for package: pdflib-devel
--> Processing Dependency: zlib-devel for package: pdflib-devel
--> Finished Dependency Resolution
Error: Missing Dependency: libpng-devel is needed by package pdflib-devel
Error: Missing Dependency: zlib-devel is needed by package pdflib-devel
================================================================
No new rpms were installed. No additional commands are required.
================================================================
Title: Re: PHP pdflib
Post by: ergozd on March 01, 2008, 09:53:29 AM
I don't think you need to install pdflib-devel package.

Install
1- pdflib RPM
2- php-pecl-pdflib RPM
3- restart your httpd-e-smith service

I compiled php-pecl-pdflib RPM in my SME7.x-DEV environment so the answer to your question is YES, it should work for SME 7.3.

More info about pdflib-devel package
Code: [Select]
http://rpmfind.net//linux/RPM/dag/redhat/el4/i386/pdflib-devel-6.0.1-1.2.el4.rf.i386.html

PDFlib is a C library for generating PDF files. It offers a graphics
API with support for drawing, text, fonts, images, and hypertext. Call
PDFlib routines from within your client program and voila: dynamic PDF
files! For detailed instructions on PDFlib programming and the
associated API, see the PDFlib Programming Manual, included in PDF
format in the PDFlib distribution.

This package contains the files needed for compiling programs that will use
the PDFlib library.
Title: Re: PHP pdflib
Post by: edb on March 02, 2008, 05:11:32 AM
Thank you very much ergozd you have been most helpfull .... :D

It is working fine ....

edb
Title: Re: PHP pdflib
Post by: ergozd on March 02, 2008, 02:31:40 PM
Glad to hear that.  :cool:
Title: Re: PHP pdflib
Post by: edb on March 03, 2008, 04:00:40 AM
hello ergozd

I have a little problem as noted in the error below:

Mar  1 21:37:33 defcon1 httpd: PHP Fatal error:  pdf_load_image(): [1110]
PDF_load_image: String parameter 'type' has bad value 'jpg' in /home/e-smith/files/ibays/store/html/ar/inv.php on line 297

Would you happen to know why it won't load a blank jpg image when it creates the pdf?

What I'm trying to do here is allow customers to print their invoices in pdf format using a blank jpg as the background.

edb
Title: Re: PHP pdflib
Post by: ergozd on March 03, 2008, 07:16:51 AM
Hi!

Quote
Would you happen to know why it won't load a blank jpg image when it creates the pdf?
1- Is the PDF file blank?

Quote
PDF_load_image: String parameter 'type' has bad value 'jpg' in /home/e-smith/files/ibays/store/html/ar/inv.php on line 297

2- What php-version are you using? 4.3.9?
Try installing (this one is compiled towards php-version 4.3.9-3.22.9 )
http://ergin.dyndns.org/download/sme7_contribs/experimental/php-pecl-pdflib-2.1.4-2eo.i386.rpm
Title: Re: PHP pdflib
Post by: edb on March 03, 2008, 07:43:49 PM
Hi ergozd

Thanks for the reply ...
I'm using PHP version 4.4.0 and yes the pdf file shows as a blank white page.

edb
Title: Re: PHP pdflib
Post by: ergozd on March 03, 2008, 07:51:55 PM
I think that explains it.

How did you upgrade to php version 4.4.0?
Title: Re: PHP pdflib
Post by: edb on March 04, 2008, 06:20:11 AM
Here is how I upgraded to PHP version 4.4.0... thanks to "Normando"
http://forums.contribs.org/index.php?topic=38367.new;topicseen#new

Proceed as following:

Add dag repo

Code:
/sbin/e-smith/db yum_repositories set dag repository \
Name 'Dag - EL4' \
BaseURL 'http://apt.sw.be/redhat/el4/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled
Code:
expand-template /etc/yum.conf
Create a local dir and download rpm

Code:
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-pear-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-pgsql-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-snmp-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-xmlrpc-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-xslt-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-devel-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-domxml-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-gd-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-imap-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-ldap-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-mbstring-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-mcrypt-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-mhash-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-mysql-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-ncurses-4.4.0-1.0.rhel4.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/4ES/i386/RPMS.cheeta/php-odbc-4.4.0-1.0.rhel4.ct.i386.rpm
Install with yum because this version require dependency  js, libmcrypt, mhash and sablotron


Code:
yum --enablerepo=* localinstall *.rpm
Then, update pear as follow:

Code:
pear install --force XML_RPC
pear upgrade --force PEAR-1.3.6 Archive_Tar-1.3.1 Console_Getopt-1.2
pear upgrade --force PEAR-1.4.11
pear upgrade PEAR
pear ua
and finally


Code:
signal-event post-upgrade
signal-event reboot


edb
Title: Re: PHP pdflib
Post by: edb on March 05, 2008, 03:47:07 AM
ergozd

Turns out that all I had to do was change my background image to be a "png" rather than a "jpg" and everything seems to work great now! My invoice text is now appearing in pdf format against my invoice image background.
I guess that the pdflib install wasn't compiled with support for jpg images for some reason.
Not sure how I could get the jpg support but for now it is working with png image support so I am thankful.

Anyway, just wanted to thank you again for helping me out as it sure is appreciated.  :grin:


edb
Title: Re: PHP pdflib
Post by: ergozd on March 05, 2008, 01:50:52 PM
Hi edb!

Glad to hear that it works.  :cool:

I have to admit I know very little about PDFLIB so I did some searching and found out more about compile options at
http://www.science.uva.nl/ict/ossdocs/php4/ref.pdf.html

I added some more compile options and generated a new RPM you might want to test
Code: [Select]
        --with-jpeg-dir=%{_prefix} \
        --with-png-dir=%{_prefix} \
        --with-tiff-dir=%{_prefix} \
http://ergin.dyndns.org/download/sme7_contribs/experimental/php-pecl-pdflib-2.1.4-3eo.i386.rpm

Good luck.
Title: Re: PHP pdflib
Post by: edb on March 05, 2008, 03:22:50 PM
Wow that is awsome ergozd!

I will give your new rpm a try but would it be too much if I asked you how to go about creating/compiling the rpm so that I could learn something new? I have VMware so I can create a SME7 test environment ...
Thanks for all your help!

edb
Title: Re: PHP pdflib
Post by: jvmartins on October 01, 2010, 06:02:18 PM
Hi,

    Need some help.

    My SME is 7.5.1 with PHP 4.3.9.

    installed nagios and PNP and one of the links shows "FPDF error: This version of PHP is not supported"

    Could anyone give me some help to overcome this?

Regards,

jvmartins
Title: Re: PHP pdflib
Post by: cactus on October 01, 2010, 06:49:27 PM
installed nagios and PNP and one of the links shows "FPDF error: This version of PHP is not supported"
The error seems pretty self explanatory to me. You are running a PHP version that is not compatible with FDPF.

Could anyone give me some help to overcome this?
Next time check the requirements and see if they are met before installing. Installing a newer PHP version on SME Server is not easy and brings you in unsupported territory.

Perhaps you can use another version of FPDF. What version are you using? Where did you get your version of FPDF from?
Title: Re: PHP pdflib
Post by: jvmartins on October 01, 2010, 07:20:05 PM
Hi,

    I just followed the nagios how-to at contribs.org.

    The insrtrutions lead us to install PNP4nagios that uses pdflib.

    It's workin now. After some reading on this forun I was able to have it working (till now!!!).

    First I installed the   "pdflib-6.0.1-1.2.el4.rf.i386.rpm" as refered in a previous post of this forum.

    Then I tried to find the "php-pecl-pdflib-2.1.4-1eo.i386.rpm" but I was not able to find it. Installed "php-pecl-pdflib-2.1.8-1.el4.remi.i386.rpm" instead.

   And last I followed the orientations to upgrade PHP from 4 to 5 in this post "http://forums.contribs.org/index.php/topic,44025.msg211521.html#msg211521"

   the commands used were:

   yum --enablerepo=centosplus install php.i386 php-pear-Net-Socket php-pear-Auth-SASL php-pear-DB php-pear-HTTP php-pear-Mail php-pear-XML-Parser

   /sbin/e-smith/signal-event post-upgrade
   /sbin/e-smith/signal-event reboot

   Now it's working. I'm able to get PDF files from my nagios performance data.

Regards,

jvmartins