PHPackages                             2lenet/pdf-generator-bundle - 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. 2lenet/pdf-generator-bundle

ActiveSymfony-bundle[PDF &amp; Document Generation](/categories/documents)

2lenet/pdf-generator-bundle
===========================

Pdf generator

4.2.3(1mo ago)218.3k↓28.1%2[1 PRs](https://github.com/2lenet/PdfGeneratorBundle/pulls)MITPHPPHP ^8.4CI passing

Since Feb 7Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/2lenet/PdfGeneratorBundle)[ Packagist](https://packagist.org/packages/2lenet/pdf-generator-bundle)[ RSS](/packages/2lenet-pdf-generator-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (61)Versions (63)Used By (0)

PdfGeneratorBundle
==================

[](#pdfgeneratorbundle)

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

[](#installation)

`composer require 2lenet/pdf-generator-bundle`

Require: unoserver (for word\_to\_pdf)

```
    unoserver:
        image: registry.2le.net/2le/2le:unoserver

```

Configuration
-------------

[](#configuration)

config (with default value):

```
lle_pdf_generator:
  path: "data/pdfmodel"
  default_generator: "word_to_pdf"
  class: 'Lle\PdfGeneratorBundle\Entity\PdfModel'
```

add routing (for show the ressource use ``)

```
lle_pdf_generator:
    resource: "@LlePdfGeneratorBundle/Resources/config/routes.yaml"
    prefix: /
```

if you create an model without type and with ressource is mydoc.doc the generator will create an pdf based on data/pdfmodel/mydoc.doc with word\_to\_pdf generator.

Configure your tags
-------------------

[](#configure-your-tags)

You can easily list the tags used in your models.

To do this, simply declare the route to the page where the tags will be listed. The name of the route is " lle\_pdf\_generator\_admin\_balise".

Example in Crudit:

```
public function getListActions(): array
    {
        $actions = parent::getListActions();

        array_unshift($actions, ListAction::new(
            "action.balise",
            Path::new('lle_pdf_generator_admin_balise'),
            Icon::new("bookmark")
        ));

        return $actions;
    }
```

If you use several document templates linked to different modules, you can declare your annotations in the pdf\_generator.yaml of your project:

```
lle_pdf_generator:
  path: "data/pdfmodel"
  default_generator: "word_to_pdf"
  data_models:
    - facture
    - commande
```

To complete the list of tags, use Symfony annotations declared in your pdf\_generator.yaml file. For example:

```
