PHPackages                             opengento/module-document - 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. opengento/module-document

ActiveMagento2-module[PDF &amp; Document Generation](/categories/documents)

opengento/module-document
=========================

This module aims to help merchants to manage easily their documents in Magento 2.

2.0.0(4y ago)68.0k↓50%2[2 issues](https://github.com/opengento/magento2-document/issues)4MITPHP

Since Dec 31Pushed 1y ago9 watchersCompare

[ Source](https://github.com/opengento/magento2-document)[ Packagist](https://packagist.org/packages/opengento/module-document)[ Docs](https://github.com/opengento/magento2-document)[ RSS](/packages/opengento-module-document/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (9)Versions (10)Used By (4)

Document Module for Magento 2
=============================

[](#document-module-for-magento-2)

[![Latest Stable Version](https://camo.githubusercontent.com/5a5f5e9730c31ac85083de6efed1baad53f1dcbbccab7798263950ecc2bcf9e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e67656e746f2f6d6f64756c652d646f63756d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/opengento/module-document)[![License: MIT](https://camo.githubusercontent.com/b6366e600c6db3ff1ca8dada0ca300c5a995ab742b698cd58290c069a69fce1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f70656e67656e746f2f6d6167656e746f322d646f63756d656e742e7376673f7374796c653d666c61742d737175617265)](./LICENSE)[![Packagist](https://camo.githubusercontent.com/0fa77c8d8908ee42ad44843c6f72bd76814058593b08148232ff291aad9e83d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70656e67656e746f2f6d6f64756c652d646f63756d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/opengento/module-document/stats)[![Packagist](https://camo.githubusercontent.com/11b7dd0c8f5933957e6779bef1471e6bf6604b7ab4fd669d5315cd6976e3fdc6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6f70656e67656e746f2f6d6f64756c652d646f63756d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/opengento/module-document/stats)

This module aims to help merchants to manage easily their documents in Magento 2.

- [Setup](#setup)
    - [Composer installation](#composer-installation)
    - [Setup the module](#setup-the-module)
- [Features](#features)
- [Settings](#settings)
- [Documentation](#documentation)
- [Support](#support)
- [Authors](#authors)
- [License](#license)

Setup
-----

[](#setup)

Magento 2 Open Source or Commerce edition is required.

### Composer installation

[](#composer-installation)

Run the following composer command:

```
composer require opengento/module-document

```

### Setup the module

[](#setup-the-module)

Run the following magento command:

```
bin/magento setup:upgrade

```

**If you are in production mode, do not forget to recompile and redeploy the static resources.**

Features
--------

[](#features)

This module aims to help merchants to manage easily their documents in Magento 2.
Documents are sorted by types and can be manipulated with ease.

- Declare new document types:

    - from the back-office
    - from xml config files
- Create new documents:

    - from the back-office
    - from command line
    - from a cron job

Documents can be uploaded with a thumbnail. The default thumbnail of the document type can be used.
The thumbnail can be resized in order to optimize the performance.

Documentation
-------------

[](#documentation)

### How to declare a document type from config file

[](#how-to-declare-a-document-type-from-config-file)

Create a new file `resource_document_types.xml` in the `etc/` folder of your module:

```

        true
        public
        Certificates
        cert/import/
        coa/
        3
        CERT-*.[pP][dD][fF]

            pdf

        document/image/cert/thumbnail.png

```

### How to add a new import file processor

[](#how-to-add-a-new-import-file-processor)

When files are import from command line or cron jobs, you cannot set manually metadata.
The code, name, and pivot field has to be filled and that is what the file import processor do.
If you need to implement your own logic on how a document should be created on the import fly, check the following code:

Implement the interface `\Opengento\Document\Model\Document\ProcessorInterface`:

```
namespace Vendor\Module\Model\Document\Processor;

use Opengento\Document\Api\Data\DocumentInterface;
use Opengento\Document\Api\Data\DocumentTypeInterface;
use Opengento\Document\Model\Document\Filesystem\File;
use Opengento\Document\Model\Document\Filesystem\Format;
use Opengento\Document\Model\Document\ProcessorInterface;
use Opengento\Document\Model\DocumentBuilder;
use function basename;
use function dirname;

final class CustomProcessor implements ProcessorInterface
{
    public const CODE = 'custom';

    /**
     * @var DocumentBuilder
     */
    private $documentBuilder;

    /**
     * @var File
     */
    private $fileHelper;

    public function __construct(
        DocumentBuilder $documentBuilder,
        File $fileHelper
    ) {
        $this->documentBuilder = $documentBuilder;
        $this->fileHelper = $fileHelper;
    }

    public function execute(DocumentTypeInterface $documentType, string $filePath): DocumentInterface
    {
        // $filePath is the path where the source file is currently saved.
        // You can change the destination path if want to.
        // Edit the file path value with $this->documentBuilder->setFilePath($newDestPath).
        // You can also rename the file with $this->documentBuilder->setFileName($newFileName)

        $destFilePath = $this->fileHelper->getFileDestPath($documentType, $filePath);
        $fileName = basename($destFilePath);

        $this->documentBuilder->setTypeId($documentType->getId());
        $this->documentBuilder->setCode(Format::formatCode($fileName));
        $this->documentBuilder->setName(Format::formatName($fileName));
        $this->documentBuilder->setFileName($fileName);
        $this->documentBuilder->setFilePath(dirname($this->fileHelper->getRelativeFilePath($destFilePath)));

        return $this->documentBuilder->create();
    }
}
```

Support
-------

[](#support)

Raise a new [request](https://github.com/opengento/magento2-document/issues) to the issue tracker.

Authors
-------

[](#authors)

- **Opengento Community** - *Lead* - [![Twitter Follow](https://camo.githubusercontent.com/f582f22fdefea808310d5426ff86d748569ab584a65c28c30eb34b72a73ba802/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6f70656e67656e746f2e7376673f7374796c653d736f6369616c)](https://twitter.com/opengento)
- **Thomas Klein** - *Maintainer* - [![GitHub followers](https://camo.githubusercontent.com/e0e283f9de9d23a7bfeac3e6088a3a3a6844c123e1861f866242cd80e3361088/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f74686f6d61732d6b6c312e7376673f7374796c653d736f6369616c)](https://github.com/thomas-kl1)
- **Contributors** - *Contributor* - [![GitHub contributors](https://camo.githubusercontent.com/8d79de9277205ff64240e09f69b3d5ac451a63603788db96922d1ad08b2f1b1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6f70656e67656e746f2f6d6167656e746f322d646f63756d656e742e7376673f7374796c653d666c61742d737175617265)](https://github.com/opengento/magento2-document/graphs/contributors)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](./LICENSE) details.

***That's all folks!***

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance21

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~24 days

Recently: every ~35 days

Total

9

Last Release

1767d ago

Major Versions

1.0.7 → 2.0.02021-07-16

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/95669?v=4)[Thom](/maintainers/thomasklein)[@thomasklein](https://github.com/thomasklein)

---

Top Contributors

[![thomas-kl1](https://avatars.githubusercontent.com/u/20971693?v=4)](https://github.com/thomas-kl1 "thomas-kl1 (34 commits)")

---

Tags

document-managementmagentomagento-2magento-extensionmagento-modulemagento2magento2-extensionmagento2-extension-freemagento2-modulephpphpmagentotoolimportextensionmoduleresourcesdocumentmagento2

### Embed Badge

![Health badge](/badges/opengento-module-document/health.svg)

```
[![Health](https://phpackages.com/badges/opengento-module-document/health.svg)](https://phpackages.com/packages/opengento-module-document)
```

###  Alternatives

[opengento/module-category-import-export

This module add the capability to import and export the categories from the back-office.

119.1k](/packages/opengento-module-category-import-export)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[redchamps/module-clean-admin-menu

It will merge all third party extensions menu items to single menu item named 'Extensions'.

164416.3k](/packages/redchamps-module-clean-admin-menu)[opengento/module-webapi-logger

This module allows you to analyze all the webapi rest done call toward your Magento.

1014.9k](/packages/opengento-module-webapi-logger)[rafaelcg/magento2-quicklink

Faster subsequent page-loads by prefetching in-viewport links during idle time

5115.9k](/packages/rafaelcg-magento2-quicklink)[opengento/composer-registration-plugin

This plugin allows to compile the Magento2 components registrations on composer install/update.

111.6k](/packages/opengento-composer-registration-plugin)

PHPackages © 2026

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