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.

2606PHP

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 3w 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 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

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

[42coders/document-templates

Document template management package.

19940.0k](/packages/42coders-document-templates)[qipsius/tcpdf-bundle

A bundle to easily integrate TCPDF into Symfony

23749.5k](/packages/qipsius-tcpdf-bundle)[macopedia/magmi2

Magento Mass Importer 'Magmi' for Magento 2

11615.7k](/packages/macopedia-magmi2)[tarfin-labs/easy-pdf

Makes pdf processing easy.

1719.4k](/packages/tarfin-labs-easy-pdf)[ikkez/f3-sheet

Some Excel and CSV utilities for PHP Fat-Free Framework

1414.8k](/packages/ikkez-f3-sheet)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.7k](/packages/nilgems-laravel-textract)

PHPackages © 2026

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