Download the PHP package quickshiftin/php-pdf-invoice without Composer
On this page you can find all versions of the php package quickshiftin/php-pdf-invoice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quickshiftin/php-pdf-invoice
More information about quickshiftin/php-pdf-invoice
Files in quickshiftin/php-pdf-invoice
Package php-pdf-invoice
Short Description Generate PDF files for your application's invoices with PHP
License OSL-3.0
Informations about the package php-pdf-invoice
PHP PDF Invoice
This project uses a PDF invoice generator extracted from Magento for general use via Composer. You can easily integrate your existing domain model and start generating PDF invoices that look like this:
Features
- Generate Invoice PDF documents
- Integrate your domain model easily by implementing Order and OrderItem interfaces
- Composer distribution
- Change background and font colors, font types, line color and provide custom logo
- Automatically create multiple pages based on number of line items
Install via Composer
./composer.phar require quickshiftin/php-pdf-invoice
Usage
Integration boilerplate - connecting your existing domain model to the generator
To integrate your existing application's orders, simply provide two classes that implement
Quickshiftin\Pdf\Invoice\Spec\Order
and Quickshiftin\Pdf\Invoice\Spec\OrderItem
OrderItem interface implementation
Order interface implementation
Implementation suggestion
Since these are interface
s, you can create a new class that wraps your existing OrderItem objects. If there are no name collisions you could also consider implementing directly on your existing OrderItem class.
Building & Styling your Invoice PDFs
This system uses Zend_Pdf
(from ZF1) under the hood. The package provides Quickshiftin\Pdf\Invoice\Factory
which is a wrapper for instantiating classes from Zend_Pdf
. You'll use these objects to customize the appearance of your PDFs.
We also assume you have an instance of an order object which implements Quickshiftin\Pdf\Invoice\Spec\Order
as described above that is stored in a variable called $myOrder
.
Notes
You can look at the test directory for usage insights. Issues and PRs welcome!