Skip to content

A PHP Wrapper Interface for the PDFTK command line utility (the manipulation of PDF files)

Notifications You must be signed in to change notification settings

ripasaha/php-pdtfk-toolkit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-pdftk-toolkit

A PHP library to that creates an interface for the PDFTK (PDF-Toolkit) command line interface (http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/).

Using simple OO methods, this project will build and run the typical command line parameters used to merge and modify PDFs.

Note: It took me 7 months to realise the repository name is spelt wrong (doh!)

Example Code:

$oPdftk = new pdftk();
$oPdftk	->setInputFile(array("filename" => $path . 'example.pdf', 'start_page' => 2))
		->setInputFile(array("filename" => $path . 'example2.pdf', 'rotation' => 90))
		->setInputFile(array("filename" => $path . 'example2.pdf', 'password' => 'password', 'alternate' => 'odd'))
		->setUserPassword("userpassword")
		->setOwnerPassword("ownerpassword")
		->setEncryptionLevel(40)
		->setOutputFile('/tmp/generated.pdf');

$oPdftk->_renderPdf();

Implemented Functionality:

  • Page Rotation
  • Adjustable encryption level
  • Open Password Encrypted PDFs
  • Create Password Encrypted PDFs
  • Use implicit pages or a range
  • Use alternate pages (odd or even)
  • Rotate pages
  • Output the PDF to the browser or a file

Installation:

Requirements:

This library requires no additional software beyond a functional version of PHP 5.2 (or greater) and version 1.45 of the pdftk binary (remember to update the binary location).

About

A PHP Wrapper Interface for the PDFTK command line utility (the manipulation of PDF files)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published