Koozali.org: home of the SME Server

PHP pdflib

jeppefugl

PHP pdflib
« 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

Offline Confucius

  • *****
  • 235
  • +0/-0
PHP pdflib
« Reply #1 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

jeppefugl

PHP pdflib
« Reply #2 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.

Offline edb

  • *
  • 548
  • +0/-0
Re: PHP pdflib
« Reply #3 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
......


Offline edb

  • *
  • 548
  • +0/-0
Re: PHP pdflib
« Reply #5 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
......

Offline edb

  • *
  • 548
  • +0/-0
Re: PHP pdflib
« Reply #6 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.
================================================================
......

Offline ergozd

  • *
  • 7
  • +0/-0
Re: PHP pdflib
« Reply #7 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.
« Last Edit: March 01, 2008, 10:03:15 AM by ergozd »

Offline edb

  • *
  • 548
  • +0/-0
Re: PHP pdflib
« Reply #8 on: March 02, 2008, 05:11:32 AM »
Thank you very much ergozd you have been most helpfull .... :D

It is working fine ....

edb
......

Offline ergozd

  • *
  • 7
  • +0/-0
Re: PHP pdflib
« Reply #9 on: March 02, 2008, 02:31:40 PM »
Glad to hear that.  :cool:

Offline edb

  • *
  • 548
  • +0/-0
Re: PHP pdflib
« Reply #10 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
......

Offline ergozd

  • *
  • 7
  • +0/-0
Re: PHP pdflib
« Reply #11 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
« Last Edit: March 03, 2008, 07:15:54 PM by ergozd »

Offline edb

  • *
  • 548
  • +0/-0
Re: PHP pdflib
« Reply #12 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
......

Offline ergozd

  • *
  • 7
  • +0/-0
Re: PHP pdflib
« Reply #13 on: March 03, 2008, 07:51:55 PM »
I think that explains it.

How did you upgrade to php version 4.4.0?

Offline edb

  • *
  • 548
  • +0/-0
Re: PHP pdflib
« Reply #14 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
......