How to use PDF document function in PHP

Source: Internet
Author: User
Tags pdflib

The PHP bundled Pdflib library may be the best Web publishing platform. A pair of typical usage:

Demand Brochure
E-commerce Shipping list

With this guide, you can learn how to use the PDF extensions in PHP4 to create PDF documents.
We also focus on using MySQL data to create PDF documents.

Content Summary


Install Pdflib 3.0.1 and PHP4.01PL2 with PDF support: You can install the latest PHP4.03PL1

Extract PDF document
(I suppose you have a little experience in configuring PHP)


Install Pdflib and PHP with PDF support.

Demand:

PHP 4.02 Download from http://php.net
Pdflib 3.0.1 Download from http://www.pdflib.com

This is how to let PDFLib3.0.1 and PHP4 work together a small secret recipe: (Foreigner very humorous ^_^)

Download the EXT/PDF/PDF.C patch directly from http://www.php.net to support Pdflib v 3.0.1

Download PDFLib3.0.1 from here http://www.pdflib.com
Applicable patches You can find http://www.pdflib.com/pdflib/patches.html here

Configure, make, and install Pdflib

#./configure--enabled-shared-pdflib
#make
#make Install
You will make Pdflib installed in/usr/local/lib.


Configure PHP
#./configure--with-apxs=/usr/bin/apxs
--WITH-GD--with-pdflib=/usr/local--with-mysql=/usr/local
--WITH-CONFIG-FILE-PATH=/ETC/HTTPD--WITH-ZLIB-DIR=/USR
--with-ttf=/usr/local/include
--WITH-JPEG-DIR=/USR--WITH-TIFF-DIR=/USR
--with-system-regex=yes--enable-debug=no

#make
#make Install


Update System Library
Insert/usr/local/lib into/etc/ld.so.conf (file)

#/sbin/ldconfig


Testing and validation
Now you need to restart Apache.
#apachectl restart


Copy pdfclock.php to the httpd directory (that is, the Web directory) ... Test.... Everything's fine.

Important Information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.