PHPackages                             einfacharchiv/unpack-pdf-attachments - 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. einfacharchiv/unpack-pdf-attachments

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

einfacharchiv/unpack-pdf-attachments
====================================

Save PDF attachments to your disk where you can use them

v2.1.0(1y ago)0156MITPHPPHP ^8.2

Since Feb 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/einfachArchiv/unpack-pdf-attachments)[ Packagist](https://packagist.org/packages/einfacharchiv/unpack-pdf-attachments)[ Docs](https://github.com/einfachArchiv/unpack-pdf-attachments)[ RSS](/packages/einfacharchiv-unpack-pdf-attachments/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

Save PDF attachments to your disk
=================================

[](#save-pdf-attachments-to-your-disk)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Authors sometimes supplement their documents with additional electronic resources. For example, a document that displays large tables of data might also provide the reader with a matching Excel spreadsheet to work with. PDF's file attachment feature is an open-ended mechanism for packing any electronic file into a PDF like this. These attachments can be associated with the overall document or with individual pages. You can unpack PDF attachments to your disk using Acrobat, Reader, or this unpack-pdf-attachments package. After unpacking an attachment, you can view and manipulate it independently from the PDF document.

einfachArchiv is a German SaaS product to organize your documents in one place and meet all legal requirements. You'll find us [on our website](https://www.einfacharchiv.com).

Requirements
------------

[](#requirements)

Behind the scenes this package leverages [PDFtk](https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit). You can verify if the binary is installed on your system by running this command:

```
which pdftk
```

If it is installed, it will return the path to the binary.

To install the binary you can use this command on Ubuntu or Debian:

```
sudo snap install pdftk
```

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

[](#installation)

You can install this package via [Composer](http://getcomposer.org). Run the following command:

```
composer require einfacharchiv/unpack-pdf-attachments
```

Usage
-----

[](#usage)

Unpacking attachments from a PDF is easy.

By default, this package unpacks all PDF attachments into the same directory.

```
(new Pdf())
    ->setPdf('document.pdf')
    ->unpack();
```

Or easier:

```
Pdf::unpackAttachments('document.pdf');
```

Sometimes you may want to use [pdftk options](https://www.pdflabs.com/docs/pdftk-man-page). To do so you can set them up using the `setOptions` method.

```
(new Pdf())
    ->setPdf('document.pdf')
    ->setOptions(['output tmp'])
    ->unpack();
```

Or as the second parameter to the `unpackAttachments` static method:

```
Pdf::unpackAttachments('document.pdf', ['output tmp']);
```

If the `pdftk` command is located elsewhere, pass its binary path to the constructor:

```
(new Pdf('/snap/bin/pdftk'))
    ->setPdf('document.pdf')
    ->unpack();
```

Or as the third parameter to the `unpackAttachments` static method:

```
Pdf::unpackAttachments('document.pdf', [], '/snap/bin/pdftk');
```

Contributing
------------

[](#contributing)

Contributions are **welcome**.

We accept contributions via Pull Requests on [Github](https://github.com/einfachArchiv/unpack-pdf-attachments).

Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improvement? Feel free to [create an issue on GitHub](https://github.com/einfachArchiv/unpack-pdf-attachments/issues), we'll try to address it as soon as possible.

If you've found a security issue, please email  instead of using the issue tracker.

**Happy coding**!

Credits
-------

[](#credits)

- [Philip Günther](https://github.com/Pag-Man)
- [All Contributors](https://github.com/einfachArchiv/unpack-pdf-attachments/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity77

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~390 days

Recently: every ~487 days

Total

6

Last Release

689d ago

Major Versions

v1.1.1 → v2.0.02024-06-22

PHP version history (4 changes)v1.0PHP &gt;=7.0

v1.1.1PHP ~7.0

v2.0.0PHP ^7.0 || ^8.0

v2.1.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7369d061aa626fd1c448315ca5e53d01daf448c6e5f37be95a46946cda406e8e?d=identicon)[Pag-Man](/maintainers/Pag-Man)

---

Top Contributors

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

---

Tags

attachmentspdfphpphppdfattachmentseinfachArchiv

### Embed Badge

![Health badge](/badges/einfacharchiv-unpack-pdf-attachments/health.svg)

```
[![Health](https://phpackages.com/badges/einfacharchiv-unpack-pdf-attachments/health.svg)](https://phpackages.com/packages/einfacharchiv-unpack-pdf-attachments)
```

###  Alternatives

[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)[mostafaznv/pdf-optimizer

PDF optimization tool for PHP and Laravel applications

170125.8k](/packages/mostafaznv-pdf-optimizer)[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)[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)
