PHPackages                             matrix2305/mcpdf - 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. matrix2305/mcpdf

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

matrix2305/mcpdf
================

PHP wrapper for mcpdf

08PHP

Since Sep 5Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PHP wrapper for MCPDF
=====================

[](#php-wrapper-for-mcpdf)

This package uses Java package created by m-click (m-click/mcpdf).

### Mcpdf

[](#mcpdf)

Mcpdf is an alternative to PDFtk with fixed unicode issues, so you can write Łódź into your forms.

It implements a small subset of PDFtk for which it implements compatible command line interface, so it can be used as a drop-in replacement for this subset of commands.

Internally it uses the iText PDF library.

### Getting Started

[](#getting-started)

Make sure you have installed a Java Runtime Environment such as OpenJDK.

### Xfdf

[](#xfdf)

This package has XfdfDocument class for generating Xfdf document.

#### Example of filling PDF fields:

[](#example-of-filling-pdf-fields)

```
    use matrix2305\Pdf\MCPDF;

    require 'vendor/autoload.php';

    $mcpdf = new MCPDF();

    $xfdf = new \matrix2305\Xfdf\XfdfDocument();
    $xfdf->addField('date', '23.05.1998');
    $xfdfPath = __DIR__.'/test.xfdf';
    $xfdf->save($xfdfPath);

    $mcpdf->setDataXfdfPath($xfdfPath);
    $mcpdf->setFlatten(true);
    $mcpdf->setFromPDFFilePath(__DIR__.'/test.pdf');
    $mcpdf->saveAs(__DIR__.'/output.pdf');

```

#### Example of set background PDF:

[](#example-of-set-background-pdf)

```
    use matrix2305\Pdf\MCPDF;

    require 'vendor/autoload.php';

    $mcpdf = new MCPDF();
    $mcpdf->setBackgroundPdfPath($backgroundPdfFilePath);
    $mcpdf->setFromPDFFilePath(__DIR__.'/test.pdf');
    $mcpdf->saveAs(__DIR__.'/fsafs.pdf');

```

#### Set Java path manually

[](#set-java-path-manually)

```
    use matrix2305\Pdf\MCPDF;

    require 'vendor/autoload.php';

    $mcpdf = new MCPDF();
    $mcpdf->setJavaPath($pathToJava);

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

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/10d069e47ef621e2f7348facfc7e181925b2d0906a554dd6f4caa69ecdb8e0a8?d=identicon)[matrix2305](/maintainers/matrix2305)

---

Top Contributors

[![matrix2305](https://avatars.githubusercontent.com/u/62420807?v=4)](https://github.com/matrix2305 "matrix2305 (2 commits)")

### Embed Badge

![Health badge](/badges/matrix2305-mcpdf/health.svg)

```
[![Health](https://phpackages.com/badges/matrix2305-mcpdf/health.svg)](https://phpackages.com/packages/matrix2305-mcpdf)
```

###  Alternatives

[phpoffice/phpspreadsheet

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

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

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/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.6M131](/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)
