PHPackages                             jdoolittle126/templateify-pdf - 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. jdoolittle126/templateify-pdf

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

jdoolittle126/templateify-pdf
=============================

Fill and flatten PDF forms programmatically, without the need for external tools.

2606↓100%PHP

Since Aug 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jdoolittle126/templateify-pdf)[ Packagist](https://packagist.org/packages/jdoolittle126/templateify-pdf)[ RSS](/packages/jdoolittle126-templateify-pdf/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Template-ify PDF
================

[](#template-ify-pdf)

Template-ify is a small PHP tool to fill and flatten PDF forms programmatically, without the need for tools such as [PDFtK](https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) installed on the server.

Installation
------------

[](#installation)

Add jdoolittle126/templateify-pdf in composer.json, or use the command:

```
composer require jdoolittle126/templateify-pdf

```

Usage
-----

[](#usage)

Template-ify takes a template PDF file and data, and produces filled PDF files. Optionally, these PDFs can also be flattened to prevent further edits. Form data is added via a 'fields' array, containing key - value pairs. The key refers to the name of the form field, and the value is the data to be entered. One caveat is that the template PDF must be of version 1.4 (Acrobat 5.x) or lower. See [Changing the PDF Version](#Changing-the-PDF-Version).

### Preparing a Template

[](#preparing-a-template)

After creating a PDF form, take note of the field names. The values `Name`, `Date`, `Email`, and `Message` will be used to identify the fields.

[![Example of Sample Form](docs/demo-form.jpg)](docs/demo-form.jpg)

### Changing the PDF Version

[](#changing-the-pdf-version)

When saving your template, be sure to choose `Adode PDF Files, Optimized`. This will reveal a settings menu that will allow the PDF to be saved in a compatibility mode required for this program to function.

[![Form Saving Options](docs/demo-save.jpg)](docs/demo-save.jpg)

In the settings dialog, select `Make compatible with: 'Acrobat 5.0 and later'`

[![Sample Form](docs/demo-version.jpg)](docs/demo-version.jpg)

### Usage

[](#usage-1)

The main function, `Templateifier::templateify`, takes 4 arguments.

- The first is `$pdfFile`, the path to the template PDF file (Ex. "docs/my\_form.pdf")
- The second is `$outputFile`, the path where the output PDF will be created (Ex. "output/my\_result.pdf")
- The third is `$flatten`, true if the outputted document should be flattened, false if not
- Forth is `$fields`, an array of field - value pairs
- Optionally, there is a `$results` parameter, which will store an exception if one occurs

```
    $pathToPdfTemplate = "path\\to\\your\\pdf";
    $pathToOutputFile = "path\\to\\your\\output\\output.pdf";
    $flattenOutput = false;
    $fields = array(
        'Name' => 'John Doe',
        'Date' => date("Y/m/d"),
        'Email' => 'johndoe@email.com',
        'Message' => 'This is a sample message that we can transfer to a PDF!'
    );

    Templateifier::templateify($pathToPdfTemplate, $pathToOutputFile, $flattenOutput, $fields);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca95bb433adad761108c5cdc65c1930b115c9c90423d2884e0b758e4c01bca15?d=identicon)[jdoolittle126](/maintainers/jdoolittle126)

---

Top Contributors

[![jdoolittle126](https://avatars.githubusercontent.com/u/15986555?v=4)](https://github.com/jdoolittle126 "jdoolittle126 (16 commits)")

---

Tags

composerpdfpdf-generation

### Embed Badge

![Health badge](/badges/jdoolittle126-templateify-pdf/health.svg)

```
[![Health](https://phpackages.com/badges/jdoolittle126-templateify-pdf/health.svg)](https://phpackages.com/packages/jdoolittle126-templateify-pdf)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.2k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M100](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M128](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

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