Download the PHP package 2lenet/pdf-generator-bundle without Composer

On this page you can find all versions of the php package 2lenet/pdf-generator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pdf-generator-bundle

PdfGeneratorBundle

Installation

composer require 2lenet/pdf-generator-bundle

Require: unoserver (for word_to_pdf)

Configuration

config (with default value):

add routing (for show the ressource use )

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

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:

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

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

If you only have on template or one module using several templates, you do not have to declare "data_models" in the pdf_generator.yaml file. By default, the Symfony annotation will be "pdfgenerator". In your entity, you will then have:

Use it

You can use the PDFgenerator with bdd or directly in code

You can create an instance of TcpdfFpdi (Tcpdf and Fpdi) with the PdfMerger

Use with your entity:

change config "class" of pdf generator "App/Entity/MyModelPdf"

Use with bdd

The model is a PdfModel with

a code, a ressource, a libelle, a type and a description

you can create a model with

!! Warning if you use your own class and this class has other field with constraint the command not work. !!

Create your own type

you can create several type of pdf (already exist tcpdf and word_to_pdf)

You can create your own type with an class which extend Lle\PdfGeneratorBundle\Generator\AbstractPdfGenerator

AbstractPdfGenerator implements Lle\PdfGeneratorBundle\Generator\PdfGeneratorInterface (autotagged lle.pdf.generator)

an exemple is:

Use the type tcpdf

An exemple for tcpdf:

You can create an pdf model in bdd with ressource "App\Service\Pdf\MyTcpdfClass" and code MYTCPDF type "tcpdf"

use the word_to_pdf (format Microsoft Word XML)

Create a .docx file /data/pdfmodel/test.docx with Hello ${name}

You can create an pdf model in bdd with ressource "test.docx" and code MYDOC type "word_to_pdf"

you can use variables ${@img[logo]:100x200} or ${@img[logo]} for create images. (regex is #^@img[(\w+)](:(\d+)x( \d+))?$#)

search to {{lle_pdf_generator.path}}/logo.png so default is data/pdfmodel/logo.png

search to /logo.png

https://phpword.readthedocs.io/en/latest/templates-processing.html

Sign pdf

Use the Lle\PdfGeneratorBundle\Lib\Signature class you can sign an pdf response or an PdfMerge

Cretae the signature

You can add an draw with signature

You can also add segment or points for create the signature picture

Pdf response

Pdf Merger

The pdfMerge is the class of instance return by generator

You can't signed a pdfMerger you have to pass by TcpdfFpdi. An PdfMerger instance can never be signed

You can continue to sign an TcpdfFpdi with $generator->signeTcpdfFpdi($pdf, $signature)

You can also use directly the signature instance for sign a Pdfmerger or TcpdfFpdi

or

You can't use several sign with PdfMerger

ieterable data

create a .docx file and create 2 table (1 line , 3 cells)

save it with myiterable.docx use the Lle\PdfGeneratorBundle\Lib\PdfIterable class

show it

Warning only the first level of data can to be an PdfIterable, you can't use ${etablissement.eleves}:

Understand the property (word to pdf)

The property is read with propertyAccesor (Symfony) but the first is beetween two "[]": [first].rest

!!! warning use the same systeme if you create your own type !!!

Merge several model

in bdd:

The default type is always the first (here "word_to_pdf")

if none type is defined the type is lle_pdf_generator.default_generator config

Migrate to pdf generator v3

There is few breaks in backward compatibility in v3. Here is the steps to migrate :


All versions of pdf-generator-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laminas/laminas-escaper Version ^2.11
symfony/property-access Version ^6.0 || ^7.0
phpoffice/phpword Version ^0.18
tecnickcom/tcpdf Version ^6.3
vich/uploader-bundle Version ^1.19 || ^2.0
symfony/yaml Version ^6.0 || ^7.0
laminas/laminas-stdlib Version ^3.15
symfony/http-foundation Version ^6.0 || ^7.0
symfony/http-client-contracts Version ^v3.4.0
doctrine/orm Version ^2.6 || ^3.0
symfony/routing Version ^6.0 || ^7.0
symfony/framework-bundle Version ^6.0 || ^7.0
doctrine/annotations Version ^1.13
symfony/serializer Version ^6.0 || ^7.0
twig/twig Version ^3.4.3
setasign/fpdi Version ^2.3.6
symfony/process Version ^6.0 || ^7.0
setasign/fpdf Version 1.8.4
alexanderpavlov/pdfmerger Version ^1.0
symfony/dotenv Version ^6.0 || ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package 2lenet/pdf-generator-bundle contains the following files

Loading the files please wait ....