PHPackages                             bensquire/php-pdftk-toolkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. bensquire/php-pdftk-toolkit

AbandonedArchivedLibrary[PDF &amp; Document Generation](/categories/documents)

bensquire/php-pdftk-toolkit
===========================

A simple PHP PDFTK wrapper.

1.2(11y ago)2910.0k↓11.1%15[2 issues](https://github.com/bensquire/php-pdftk-toolkit/issues)MITPHPPHP &gt;=5.3.0

Since May 23Pushed 10y ago6 watchersCompare

[ Source](https://github.com/bensquire/php-pdftk-toolkit)[ Packagist](https://packagist.org/packages/bensquire/php-pdftk-toolkit)[ Docs](https://github.com/bensquire/php-pdftk-toolkit)[ RSS](/packages/bensquire-php-pdftk-toolkit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

php-pdftk-toolkit
=================

[](#php-pdftk-toolkit)

A PHP library to that creates an interface for the PDFTK (PDF-Toolkit) command line interface ().

A simple PSR-0 compliant library, this project will build and run the typical command line parameters used to merge and modify PDFs.

Note: If your looking for the simpler non PSR-0 compliant module, then you can download the tagged 'v1' commit.

Example Code:
-------------

[](#example-code)

```
//Initiate autoloader

use Pdftk\Pdftk;

$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:
--------------------------

[](#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:
-------------

[](#installation)

- Download and install the PDFTK binary
- Download this PHP library
- Update the location of the PDFTK binary within this library
- Try the examples!
- Provide Feedback :)

Requirements:
-------------

[](#requirements)

This library requires no additional software beyond a functional version of PHP 5.3 (or greater) and version 1.45 of the pdftk binary (remember to update the binary location if its not in /usr/local/bin).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4378d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e6b8deb039bf943cedf1ae097e2e208c0bb8bfbd9926dc62896dc62bcb0a13e?d=identicon)[thfava](/maintainers/thfava)

---

Top Contributors

[![bensquire](https://avatars.githubusercontent.com/u/600237?v=4)](https://github.com/bensquire "bensquire (39 commits)")[![NickDickinsonWilde](https://avatars.githubusercontent.com/u/92694?v=4)](https://github.com/NickDickinsonWilde "NickDickinsonWilde (3 commits)")[![alexgann](https://avatars.githubusercontent.com/u/1827295?v=4)](https://github.com/alexgann "alexgann (1 commits)")[![strongwazz](https://avatars.githubusercontent.com/u/911315?v=4)](https://github.com/strongwazz "strongwazz (1 commits)")

---

Tags

phppdfpdftk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bensquire-php-pdftk-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/bensquire-php-pdftk-toolkit/health.svg)](https://phpackages.com/packages/bensquire-php-pdftk-toolkit)
```

###  Alternatives

[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k77.1M493](/packages/mpdf-mpdf)[imal-h/pdf-box

The most advanced, driver-based PDF manipulation library for PHP v3.0. Supports Ghostscript, Chrome Headless (HTML to PDF), OpenSSL/FPDI (Signing), and PDFtk (Forms).

60403.9k](/packages/imal-h-pdf-box)[pontedilana/php-weasyprint

PHP library allowing PDF generation from an url or a html page. Wrapper for Kozea/WeasyPrint.

761.1M7](/packages/pontedilana-php-weasyprint)[daandesmedt/phpheadlesschrome

A PHP wrapper for using Google Chrome Headless mode. Convert URL or HTML to a PDF / screenshot. Easy to use and OOP interfaced.

92233.1k](/packages/daandesmedt-phpheadlesschrome)[kartik-v/mpdf

A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support. This is a fork of the official mPDF library.

39328.4k1](/packages/kartik-v-mpdf)[kiwilan/php-ebook

PHP package to read metadata and extract covers from eBooks, comics and audiobooks.

3414.6k1](/packages/kiwilan-php-ebook)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
