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.

Roles

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

Roles

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.

Roles

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

Roles

Examples


Example 01

1 -Text

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

Run 1 »

Example 02

2 -Order

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

Run 2 »

Example 03

3 -Shipping label

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

Run 3 »

Example 04

4 - Energy Bill

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

Run 4 »

Example 05

5 - Charts

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

Run 5 »

 

Other projects


PDFReportDesigner - Design Stunning PDF Reports Visually

Get ready for a game-changer! We're developing a new Windows application that will let you visually create PDFReport 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.



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.