Download the PHP package dgarden/gotenberg-bundle without Composer
On this page you can find all versions of the php package dgarden/gotenberg-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dgarden/gotenberg-bundle
More information about dgarden/gotenberg-bundle
Files in dgarden/gotenberg-bundle
Package gotenberg-bundle
Short Description Gotenberg PDF generation bundle
License MIT
Informations about the package gotenberg-bundle
Digital Garden Gotenberg Bundle.
Installation guide
To install this bundle, just do :
If you're in a symfony project with config/routes
and config/packages
, configuration
has to be created, if not you can copy/paste these configurations :
With flex enabled, you should also have Sensiolabs Gotenberg bundle configuration file created :
Configuration
Digital Garden Gotenberg Bundle's configuration :
Check also the Sensiolabs Gotenberg bundle documentation to
know how to configure the connexion to the Gotenberg API, but mainly you'll just have to set the environment
variable GOTENBERG_DSN
.
For example (set has default env variable in config/packages/gotenberg.yaml
):
Service PdfFileGenerator
This bundle add to the container a new service dgarden.gotenberg.generator
or
̀DigitalGarden\GotenbergBundle\Generator\PdfFileGeneratorInterface
with the following
helpers :
-
html(string $html, string $output, PdfFileGeneratorOptions|array $options = PdfFileGeneratorOptions::DEFAULT): SplFileInfo;
: Generate a PDF file from HTML.Example:
-
htmlFile(string $file, string $output, PdfFileGeneratorOptions|array $options = PdfFileGeneratorOptions::DEFAULT): SplFileInfo
: Generate a PDF file from an HTML file.Example:
-
merge(string $output, string ...$paths): SplFileInfo
: Merge several PDF files into one (with default options). The last file name given is used as the output file.Example:
-
mergeWithOptions(PdfFileGeneratorOptions|array $options, string $output, string ...$paths): SplFileInfo
: Merge several PDF files into one (with options).Example:
-
template(string $template, string $output, array $context = [], PdfFileGeneratorOptions|array $options = PdfFileGeneratorOptions::DEFAULT): SplFileInfo
: Generate a PDF file from a template.Example:
-
url(string $url, string $output, PdfFileGeneratorOptions|array $options = PdfFileGeneratorOptions::DEFAULT): SplFileInfo
: Generate a PDF file from url.Example:
These helpers use PdfFileGeneratorOptions
which are :
OPTION_ASYNC
(bool) (default false) : If true, enable the asynchronous generation (see Asynchronous generation chapter.).
Commands
Here the list of commands added by the bundle.
Asynchronous generation
Gotenberg includes the possibility to generate pdf asynchronously, meaning that you ask it to generate your pdf then send a webhook to your application when it finishes.
DigitalGardenGotenbergBundle includes, if your project has controllers dependency and a router, a route Gotenberg can access to :
So, everytime you make an asynchronous request, PdfFileGenerator
service will get this route
url from your router and send it to Gotenberg.
Contribution
If you want to contribute, please follow these rules :
- Respect Gitflow: Respect following branches :
- develop: Contains the last version of the bundle code.
- master: Contains the production version of the bundle code.
- **feature/*: Branches adding new features to the bundle. They have to be merged on develop**, and will be merge to master with the next release.
- **bugfix/*: Branches fixing non-blocking bugs. They have to be merged on develop**, and will be merge to master with the next release.
- **hotfix/*: Branches fixing blocking bugs. They have to be merged on develop, master and every opened releases. After merging them to master, create a new patch version**. (ex: v0.2.0 -> v0.2.1)
- **release/*: Branches containing future releases. They can be edited and will be merged, when finished, to develop and master. After merged to master, create a new minor version** (ex: v0.2.1 -> v0.3.0) or major version (ex: v0.2.1 -> v1.0.0). To know if you need to increase the major version, ask yourself :
- Does my release add a game-changing functionality.
- Does my release breaks the retro-compatibility of the bundle.
- Does that release will have to evolve in parallel to the current version.
- Launch and edit tests: If you run
phpunit
on this bundle, you'll have coverage generated in.phpunit-cache/code-coverage
directory, take a look. - Edit the CHANGLOG.md file with your changes.
- Edit the TODO.md file with your ideas if any.
All versions of gotenberg-bundle with dependencies
symfony/console Version ^7.1
sensiolabs/gotenberg-bundle Version ^0.3.1