Proposal to generate an invoice with Gotenberg#382
Open
StevenRenaux wants to merge 1 commit intoSylius:2.0from
Open
Proposal to generate an invoice with Gotenberg#382StevenRenaux wants to merge 1 commit intoSylius:2.0from
StevenRenaux wants to merge 1 commit intoSylius:2.0from
Conversation
Neirda24
reviewed
Jul 30, 2025
| <tr> | ||
| <td> | ||
| <img width="160" src="{{ logoPath }}"> | ||
| <img width="160" src="{{ generateWithGotenberg ? gotenberg_asset(logoPath) : logoPath }}"> |
There was a problem hiding this comment.
inject the config key $config['pdf_generator']['generate_with_gotenberg'] to wrap this logic in an if maybe ?
Neirda24
reviewed
Jul 30, 2025
| "php": "^8.2", | ||
| "knplabs/knp-snappy-bundle": "^1.10", | ||
| "ramsey/uuid": "^4.7", | ||
| "sensiolabs/gotenberg-bundle": "^1.0", |
Jean-Beru
reviewed
Nov 22, 2025
|
|
||
| if ($config['pdf_generator']['generate_with_gotenberg'] === true) { | ||
| $definition = new Definition(TwigToGotenbergPdfGenerator::class); | ||
| $definition->addArgument(new Reference('sensiolabs_gotenberg')); |
There was a problem hiding this comment.
We should check if the bundle is installed and throw an exception if necessary.
IMO the bundle should be optional.
| if ($config['pdf_generator']['generate_with_gotenberg'] === true) { | ||
| $definition = new Definition(TwigToGotenbergPdfGenerator::class); | ||
| $definition->addArgument(new Reference('sensiolabs_gotenberg')); | ||
| $definition->setDecoratedService('sylius_invoicing.generator.twig_to_pdf'); |
There was a problem hiding this comment.
Is decoration needed since we just replace the service?
| ->children() | ||
| ->booleanNode('enabled')->defaultTrue() | ||
| ->end() | ||
| ->booleanNode('generate_with_gotenberg')->defaultFalse() |
There was a problem hiding this comment.
What about adding a service property to set the PDF generator to use? It could be Wkhtmltopdf by default to avoid BC break and Gotenberg if the bundle is installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #376
A simple implementation for GotenbergBundle, potentially replacing wkhtmltopdf.
While integration with GotenbergBundle is possible and desirable, further testing and implementation will be required for a smooth transition of all current use cases.
Rendering by GotenbergBundle
