Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Apache Fop Laravel Package

goetas/apache-fop

PHP wrapper for Apache FOP that renders XSL-FO documents into PDF and other output formats. It offers a simple API to run FOP transformations and integrate FO-based PDF generation into Laravel or any PHP application.

View on GitHub
Deep Wiki
Context7

Symfony2 Apache FOP Bundle

Frequently asked questions about Apache Fop
How do I install goetas/apache-fop in a Laravel application?
In practice you should not install it. The package is a Symfony2 bundle rather than a plain Composer library, and its composer.json pins symfony/framework-bundle and symfony/http-kernel to the 2.x line, which will not resolve alongside modern Laravel. Forcing it with --ignore-platform-reqs or version aliasing invites autoload conflicts at runtime. The realistic approach is to treat the repository as a reference implementation and vendor the small amount of FOP CLI glue into your own app.
Does goetas/apache-fop support Laravel 8, 9, 10 or 11?
No. The bundle targets Symfony 2, which reached end of life in November 2018, while Laravel 8 and newer ship Symfony 5 or 6 components. The package has no Laravel service provider, facade, or config publishing, so none of its intended integration surface maps onto Laravel anyway. Even with a forced install you would get a Symfony Bundle subclass and DI compiler passes that Laravel cannot use.
What does goetas/apache-fop actually do under the hood?
It is a thin wrapper that shells out to the Apache FOP command-line tool. It assembles the arguments for your input XML, XSLT or FO stylesheet, and output path, runs the FOP process, and returns a file handle for the generated PDF. All layout, font handling, and rendering work is done by FOP itself. The PHP portion is only a few hundred lines of glue.
Is goetas/apache-fop still maintained and safe for production?
It is effectively abandoned: the last release was 2017-05-24, it has around 8 stars and no dependents, and there is no PHP 7.4 or 8.x verification. That means no bug fixes, no security response, and likely deprecation warnings or fatal errors on current PHP versions. An unmaintained dependency sitting in your PDF generation path is also a compliance flag for regulated environments. The one mitigating factor is that Apache FOP upstream is actively maintained under Apache 2.0, so the risk is entirely in the PHP wrapper, not the rendering engine.
What are the system requirements for converting XSL-FO to PDF with Apache FOP in PHP?
You need a JVM (JDK or JRE) in the deployment image plus the Apache FOP 2.x binaries, and you need to point the wrapper at that executable. FOP also expects its own configuration, typically an fop.xconf file and font directories, which becomes an infrastructure concern your PHP image normally does not have. Expect extra container size and cold-start cost, and plan for font availability differing between local and production. You will also need people who can author and maintain XSLT and XSL-FO stylesheets.
How do I configure the Apache FOP executable path in a Laravel app?
Put the binary path in a config file such as config/fop.php reading from an environment variable, then resolve the client as a singleton in a small FopServiceProvider. Pass the path explicitly to the client constructor rather than relying on a global constant, so tests can swap in a fake. Also make the fop.xconf path, font directory, process timeout, and temp directory configurable. This narrow contract is all most applications need.
Can I convert XSL-FO to PDF in Laravel without this package?
Yes, and that is the recommended route. Symfony Process is already a Laravel dependency, so there is no version conflict, and a roughly 200-line client covers argument building, the fop.xconf flag, timeouts, and temp-directory isolation. Expose a single method in the shape of render(xmlPath, xsltPath, outputPath): string. Prove the pipeline by running fop by hand on the command line before writing any PHP.
What are the best alternatives to goetas/apache-fop for PDF generation in Laravel?
If you only need ordinary documents, DomPDF, mPDF, or Browsershot/Puppeteer driven HTML-to-PDF are far cheaper operationally because they avoid a JVM in your deployment. Choose Apache FOP only when XSL-FO features are genuinely required, such as PDF/A output, precise pagination, footnotes, multi-column layouts, barcodes, CJK or RTL text, or accessibility tagging. Evaluate candidates against those layout requirements rather than against the wrapper's API. If you keep FOP, write your own thin client instead of adopting the abandoned bundle.
When should I use XSL-FO instead of HTML-to-PDF like DomPDF or Browsershot?
XSL-FO earns its complexity when you need print-grade control: PDF/A compliance, exact page breaks and running headers, footnotes, multi-column flow, barcodes, CJK or RTL typesetting, or accessibility tagging. If your output is a straightforward invoice or report, an HTML renderer will satisfy the layout at much lower operational cost. Confirm the requirement before introducing a second runtime into your stack. If the hand-run FOP pipeline cannot produce an acceptable artifact, stop there rather than building the PHP layer.
How do I test Apache FOP PDF generation in a Laravel test suite?
Test the engine outside PHP first by running the fop command manually against fixture XML and stylesheets and inspecting the output. In PHPUnit, fake or mock the process runner so unit tests assert the correct arguments, config path, and timeout without launching a JVM. For integration tests, assert the output file exists and starts with the PDF signature, and keep one or two golden-file comparisons for layout regressions. Keep a real FOP run in a small, slow test group rather than the default suite.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections