PDF customization
=================

The `TCPDF <http://www.tcpdf.org/>`_ library is used to create PDF documents.
While extending the TCPDF class, I have tried to follow the TCPDF author's
convention to start method names with a capital letter. 

It is possible to customize the layout of invoices and quotations by extending
the two classes ``InvoicePDF`` and ``QuotationPDF`` respectively.

The directory :file:`plugins/pdf` contains all custom PDF layout
implementations. Have a look at the file :file:`invoice_example.php` to see a
sample customization. Refer to the full implementation in :file:`lib/pdf.php`
to see which methods and members can be used and overwritten.

Invoices
--------

Give your class a speaking name (for example ``AcmeInvoicePDF``) and name the
file accordingly (:file:`plugins/pdf/acme_invoice.php`).

This class must extend the class ``InvoicePDF``.

Quotations
----------

In order to customize the layout of quotations, the class ``QuotationPDF`` must
be extended.

Sitewide settings
-----------------

In the *Sitewide settings* section, under the *PDF Settings* tab, the desired
templates can be selected for both invoices and quotations. In the case of the
above example, the option ``AcmeInvoicePDF`` will show up in the *Invoice
template* selection box.
