PHP PDF 文件產生器

2010032421:06

HTML2PDF
http://html2fpdf.sourceforge.net/
把 HTML 轉成 PDF

有關中文支援的文章 PHP - convert HTML to PDF (Unicode)
不過某些字無法正常顯示:如「校」




FPDF
http://www.fpdf.org/
純 PHP 寫的 class, 不須額外其他程式或 library

    * Choice of measure unit, page format and margins
    * Page header and footer management
    * Automatic page break
    * Automatic line break and text justification
    * Image support (JPEG, PNG and GIF)
    * Colors
    * Links
    * TrueType, Type1 and encoding support
    * Page compression

不支持 Unicode
另有他人改過支持中文

<?php
require('fpdf.php');

$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>


PHP4 / PHP5 都可

License: 不限商業



UFPDF
http://www.acko.net/blog/ufpdf
由 FPDF 修改而來,支持 UTF-8

License: GPL





TCPDF
http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf
demo http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf_examples

Main Features:

    * no external libraries are required for the basic functions;
    * supports all ISO page formats;
    * supports custom page formats, margins and units of measure;
    * supports UTF-8 Unicode and Right-To-Left languages;
    * supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
    * supports document encryption;
    * includes methods to publish some (x)HTML code;
    * includes graphic (geometric) and transformation methods;
    * includes Javascript and forms support;
    * includes a method to print various barcode formats: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS;
    * includes methods to set Bookmarks and print a Table of Content;
    * includes a method to move pages;
    * includes methods for automatic page header and footer management;
    * supports automatic page break;
    * supports automatic page numbering and page groups;
    * supports automatic line break and text justification;
    * supports JPEG and PNG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick;
    * supports stroke and clipping mode for text;
    * supports clipping masks;
    * supports Grayscale, RGB, CMYK, Spot Colors and Transparencies;
    * supports several annotations, including links, text and file attachments;
    * supports page compression (requires zlib extension);
    * supports text hyphenation;
    * supports transactions to UNDO commands;
    * supports digital signatures.

中文的支援參考:
使用TCPDF输出完美的中文PDF文档 http://www.yinzhili.com/2009/08/using-tcpdf-to-generate-pdf-in-chinese.html
[php tech.] fpdf, tcpdf hack with unicode chinese http://blog.hinablue.me/472
tcpdf的使用(中文) http://www.jjleng.cn/article/09-10/pdf.html




html2ps
http://www.tufat.com/script19.htm
這個比較複雜,需要額外安裝蠻多東西

Requirements
* PHP 4.3.0 or higher
* Ability to change the permissions of files and folders
* PHP GD2, with JPG and TTF support
* AFPL or GPL GhostScript 8.0 or higher
* Adobe Acrobat Reader
* GhostView 4.7 or higher



PFDLib

http://www.pdflib.com/pdflib-gmbh/




HTML_ToPDF
http://www.rustyparts.com/pdf.php
把 HTML 轉成 PDF




cPdfWriter
http://www.palos.ro/2006/12/20/cpdfwriter-library/
PHP5 class for exporting PDF documents based on FPDF and other related scripts.

License: LGPL



dompdf
http://www.digitaljunkies.ca/dompdf/
demo http://www.digitaljunkies.ca/dompdf/examples.php#demo
把 HTML 轉成 PDF
PHP5 oly
Licence: LGPL



RSS to PDF Newspaper
http://fivefilters.org/pdf-newspaper/
License: AGPL