Welcome to AlienProject

Passion for software brought us here. We believe that sharing code is an important thing that helps personal and community growth.


PDFReport component for PHP

A PHP library that's easy to include in any project using Composer to generate professional-looking PDF documents with just a few lines of code. All the visual aspects of the PDF document (layout and data binding) are described in an easily customizable XML template, eliminating the need to modify the PHP code for each report change.

Main key advantages in 7 steps:

1/7 - Easy to install

Run a "composer" command to automatically download, install, and configure the autoload library. The library consists of a folder with a set of files (PHP classes).


2/7 - Minimal PHP code

Learn how creating a PDF document requires just a few lines of PHP code compared to traditional methods, such as using TCPDF directly.

PHP example code for a simple hello word page. Basically in most cases you only specify which template to use and what data to pass to the template.

XML template example. All report design specifications are defined at this level. Placeholders (database variables and fields) will be automatically replaced with data.


3/7 - Separation of Design and Logic

PDFReport separates the document's design (in XML templates) from the PHP logic, making collaboration between developers and designers seamless. Developers focus on PHP code, database designers focus on data, while visual designers work on the layout. XML templates can be stored as XML files or as text in a "text" field in the database. This way, with a few lines of PHP code, you can decide which template to use.

Watch the preview video of the "PDF Report Designer" in action.

User roles diagram - Developers, Designers, DBAs

4/7 - Easy Customization and Variations

Creating new versions of PDFs (for example, with different languages or different layouts) is very easy: just edit the XML template using any text editor.

In addition, a visual tool will soon be available that will allow you to generate and edit XML templates even easier and faster. This tool is under development. A good part of the example templates were created using the beta version of this tool.

Example Case "a" - A Multi-Language Template

Example Case "b" - Custom Styles

PDFReportDesigner application screenshot

5/7 - Efficiency and Maintainability

The PDFReport architecture results in cleaner, more readable and easier to maintain code over time, reducing complexity and development effort for both the PHP code part and the visual XML template part.

Happy PHP developer - few code, lower complexity and easier maintenance

6/7 - Powered by TCPDF Engine

PDFReport leverages the power and reliability of TCPDF, a well-established, active, robust and reliable PHP library for PDF generation, inheriting its extensive functionality. The "composer" installation command automatically installs it as a dependency.

7/7 - Abstracting Data Sources

PDFReport features a Data Provider Interface, acting as an adapter for database access. This design ensures technology independence from the underlying data source. We currently offer four ready-to-use adapters: two leverage standard PHP technologies (MySQLi and PDO), while the other two integrate with popular ORMs from Symfony and Laravel."

It's always possible, however, to implement your own custom data provider to support other data access methods (for example a connector to read data from a CSV or Excel file).

For more information visit the GitHub page. Online guide for installing and using the library

PDFReport architecture diagram - PHP code, Data Provider, XML Template, TCPDF engine

Examples

In the reserved area, you can also download the PHP code in addition to the XML templates for these examples. You can also edit the XML templates and dynamically generate the report to test the template changes.


Example 01 - Text, lines, style, colors, border

1 - Text & Shapes

Example of characters with different size, type, color, style, background fill, border..

Run   XML

Example 02 - Multiple page order using master and details data from database

2 - Sales order

Order multipage example based on multiple tables (master and details data rows).

Run   XML

Example 03 - Shipping double label based on data

3 -Shipping label

Shipping double label exampled based on single table/row data.

Run   XML

Example 04 - Energy bill with consumption details and ring chart

4 - Energy Bill

Example of energy bill with consumption details and ring chart (data binding via variables or data providers)

Run   XML

Example 05 - Charts capability

5 - Charts

Example of charts (data binding via variables or data providers)

Run   XML

Example 06 - Sales invoice

6 - Sales invoice

Example of multipage sales invice document (data binding via variables and data providers)

Run   XML


Other projects


PDFReportDesigner - Design XML templates visually

Get ready for a game-changer! We're developing a new Windows application that will let you visually create PDFReport XML templates, dramatically speeding up your report development. In fact, every example report you see on this site was built using our prototype! Say goodbye to tedious coding and hello to intuitive design.


As soon as the first official version is available, a dedicated page will be published on this site

Watch more videos in the dedicated section.


About us

We are a small group of professional software developers who created this library in our spare time, partly out of passion and partly because we believe in free software. We pay for maintaining our servers, so if you find this software useful, a small, free donation would be a huge help.


Contact Us

For any questions, log in to the members' area and contact us using the email address found on the main member's page. We will respond as soon as possible. For security reasons (anti-spam), we do not publish email addresses on public pages.