datadebasa / array2print
There is no license information available for the latest version (v1.2) of this package.
A PHP library to convert array data into PDF with table and signature
v1.2
2025-04-24 03:29 UTC
Requires
- php: >=7.4
- tecnickcom/tcpdf: ^6.9
README
A PHP library to convert array data into PDF with table and signature section.
Installation
You can install the library using Composer:
composer require datadebasa/array2print
Usage
Here's a simple example of how to use the library:
<?php require 'vendor/autoload.php'; use DataDebasa\Array2Print\Array2Print; // Sample data $data = [ ['id' => 1, 'name' => 'John Doe', 'email' => 'john@example.com'], ['id' => 2, 'name' => 'Jane Smith', 'email' => 'jane@example.com'], ]; // Headers for the table $headers = [ 'id' => 'ID', 'name' => 'Name', 'email' => 'Email' ]; // Create PDF $pdf = new Array2Print(); $pdf->setData($data) ->setHeaders($headers) ->setSignature('John Manager', 'Manager') ->generate() ->output('report.pdf');
Features
- Convert array data to PDF table
- Customizable headers
- Signature section with name and title
- Automatic table formatting
- Downloadable PDF output
Requirements
- PHP 7.4 or higher
- TCPDF library (automatically installed via Composer)
License
This project is licensed under the MIT License.