sylius/pdf-generation-bundle
Sylius PDF Generation Bundle adds PDF document creation to Sylius stores, enabling configurable invoices, order confirmations, and other printable documents through flexible templates and service-based integration.
Build vs. buy for document generation: This bundle is a concrete "buy" option that wraps existing PDF engines (wkhtmltopdf via KnpSnappy, Dompdf, Gotenberg/Chromium) behind a stable interface. A PM can defer the "which PDF engine?" decision entirely—adapter swapping is a config change, not a rewrite. This preserves roadmap flexibility for invoice, receipt, coupon, and statement generation features.
Multi-tenant / multi-brand document strategy: Context routing (invoice, receipt, coupon, default) lets one codebase serve different document types with different engines, storage backends (Flysystem/S3, Symfony filesystem, Gaufrette), and options. This directly supports go-to-market in regulated vs. non-regulated segments without forking the codebase.
Feature scope for document pipelines: Because storage, rendering, and file persistence are separate contracts (PdfFileManagerInterface, PdfStorageInterface, PdfFileGeneratorInterface), a PM can stage delivery—ship rendering first, add S3 archival, retention policies, and download endpoints later—without resequencing the roadmap.
Infrastructure migration decisions: Swapping from wkhtmltopdf (aging, security-sensitive) to Gotenberg/headless Chromium is a per-context config change. This de-risks the "modernize PDF rendering" roadmap item into an incremental, reversible rollout rather than a flag-day migration.
Customization without engineering escalation: Options processors and custom adapters/extensions mean customer-specific PDF tweaks (paper size, headers, allowed files, security flags) become configuration tasks rather than core-product roadmap items—useful for enterprise deals.
Use cases supported: invoicing (Sylius-native context), receipts, coupons/vouchers, statements, contracts, shipping labels—anywhere HTML/Twig → PDF is needed with per-type output requirements.
Adopt when:
Look elsewhere or pause when:
For executives (30 seconds): "This bundle lets us generate invoices, receipts, and statements from the same HTML templates we already have, but lets each document type use a different PDF engine and storage destination—all configuration, not new code. It means we can change PDF providers (for cost, security, or quality) without rewriting our document features, and it isolates us from vendor lock-in. The main caveat: it's an early-stage package (tiny community, no known production users), so we'd pilot it behind our invoicing feature rather than betting the platform on it—and keep a one-afternoon fallback to a direct library integration."
For engineering leads:
"MIT-licensed Symfony bundle with clean interfaces—TwigToPdfRenderer, HtmlToPdfRenderer, PdfGenerationAdapterInterface, and per-context PdfStorageInterface—plus attribute-based extension points (AsPdfGenerationAdapter, AsPdfOptionsProcessor, AsPdfGeneratorProvider). Compiler passes wire contexts into service locators, so adapter and storage strategy is per-context config. It removes the need for us to build and maintain adapter routing and storage abstraction ourselves. Trade-offs: small maintainer base, no dependents to benchmark against, so we should vendor-pin it, run a spike, and validate the Gotenberg and Flysystem paths before committing."
For product/roadmap (decision frame):
How can I help you explore Laravel packages today?