PHP and PDFlibSouth Florida PHP Users Group                   Adam Culp                 http://www.Geekyboy.comIn this ses...
PHP and PDFlibThe Source  Http://www.pdflib.com/
InstallationInstallation is as easy as 1-2-3  Copy the application to modules directory     /usr/lib/php5/20090626+lfs  Ad...
Free VS CommercialPDFlib has a lite version as well as Commercial  Lite is free, but limited functionally  Lite is not pre...
CapabilitiesToo many capabilities to cover here...  Merge multiple PDF files  Fill in form on PDF and save  Create complex...
BasicsTo use PDFlib in PHP you simply:  Instantiate PDFlib  Customize your object  Output two ways     Dump to screen from...
StructureNecessary code elements:      $p = new PDFlib();      $p->begin_document($outfilename, "openmode=none");      $p-...
Upcoming SlideShare
Loading in …5
×

PHP and PDFLib

1,644 views
1,474 views

Published on

Using PDFLib with PHP 101

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,644
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

PHP and PDFLib

  1. 1. PHP and PDFlibSouth Florida PHP Users Group Adam Culp http://www.Geekyboy.comIn this session we will cover some basics of using PDFlib with PHP. We will install the application, cover where to find more info and resources, and basic usage.
  2. 2. PHP and PDFlibThe Source Http://www.pdflib.com/
  3. 3. InstallationInstallation is as easy as 1-2-3 Copy the application to modules directory /usr/lib/php5/20090626+lfs Add module to php.ini (extension=libpdf_php.so) Restart Apache Use PDFLib
  4. 4. Free VS CommercialPDFlib has a lite version as well as Commercial Lite is free, but limited functionally Lite is not pre-compiled Commercial is fully functional (for $1.1K, or $2.2K) Commercial can be used fully, but has watermark until licensed.
  5. 5. CapabilitiesToo many capabilities to cover here... Merge multiple PDF files Fill in form on PDF and save Create complex document layout Populate pre-built blocks in PDF
  6. 6. BasicsTo use PDFlib in PHP you simply: Instantiate PDFlib Customize your object Output two ways Dump to screen from buffer as download header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=businesscard.pdf"); Save to hard drive with file_put_contents
  7. 7. StructureNecessary code elements: $p = new PDFlib(); $p->begin_document($outfilename, "openmode=none"); $p->begin_page_ext(10, 10, ""); // add stuff here using methods $p->end_page_ext(""); $p->end_document(""); $buf = $p->get_buffer(); $len = strlen($buf); // output to browser as download header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=hello.pdf"); print $buf; // or save to disk file_put_contents($searchpath . / . $filename, $buf);

×