怎樣在PHP中使用PDF文檔功能

來源:互聯網
上載者:User

PHP捆綁PDFLIB庫也許是最好的web出版平台了。一對典型的用法:

需求小冊子
電子商務發貨單

通過這個指南,你可以學會怎樣使用php4中的PDF擴充來建立PDF文檔。
我們也把焦點放在用mysql資料來建立PDF文檔。

內容摘要


安裝PDFLib 3.0.1 和有PDF支援的PHP4.01pl2(譯註:你可以安裝最新的php4.03pl1)

提取PDF文檔
(我假設你有一點配置php的經驗)


安裝PDFLib和有PDF支援的PHP。

需求:

PHP 4.02 從 http://php.net 下載
PDFLib 3.0.1 從 http://www.pdflib.com 下載

這是一個怎樣讓PDFLib3.0.1和php4一起工作的小秘方:(老外很幽默的^_^)

直接從http://www.php.net下載 ext/pdf/pdf.c的補丁來支援PDFLib v 3.0.1

下載PDFLib3.0.1從此處 http://www.pdflib.com
適用的補丁你可以在此找到 http://www.pdflib.com/pdflib/patches.html

配置,Make和安裝PDFLib

#./configure --enabled-shared-pdflib
#make
#make install
你會使得 PDFLib 安裝在 /usr/local/lib .


配置 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


更新系統庫
插入 /usr/local/lib 進 /etc/ld.so.conf (檔案)

#/sbin/ldconfig


測試和驗證
現在你需要重啟apache
#apachectl restart


拷貝pdfclock.php 到的httpd目錄中(就是web目錄)...測試....一切正常。

重要訊息

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.