edisonneza / jspdf-invoice-template

PDF template created to generate invoices based on props object. Using jsPDF library.

Home Page:https://edisonneza.github.io/jspdf-invoice-template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding Columns to Footer

lokacoding opened this issue · comments

Can you enhance the footer?
Instead of only the text to a maybe 3-4 line height text with styling and font sizes?
Often you need to put legal information on an invoice like tax-numbers and stuff like this.
Also the text then should adjustable in the row or table with an option to align it left, center, right.

That would be awesome!

Example:

https://www.whmcs-deutschland.eu/wcf/index.php?attachment/204-rechnung-762-page-001-jpg/

maybe like this:

footer?: {
 *       text?: string,
 *   },
 *   footer1?: {
 *       text?: string,
 *       align?: string,
 *       style?: { width?: number },
 *       margin?: {
 *        bottom?: number,
 *        left?: number
 *      }
 *   },
 *   footer2?: {
 *       text?: string,
 *       align?: string,
 *       style?: { width?: number },
 *       margin?: {
 *        bottom?: number,
 *        left?: number
 *      }
 *   },
 *   footer3?: {
 *       text?: string,
 *       align?: string,
 *       style?: { width?: number },
 *       margin?: {
 *        bottom?: number,
 *        left?: number
 *      }
 *   },
 //...
 
  if (param.pageEnable) {
        // current state:
        //doc.text(docWidth / 2, docHeight - 10, param.footer.text, "left");
        //added here also with the margin.
        doc.text(docWidth / 2, docHeight - 10, param.footer1.text, param.footer1.align);
        doc.text(docWidth / 2, docHeight - 10, param.footer2.text, param.footer2.align);
        doc.text(docWidth / 2, docHeight - 10, param.footer3.text, param.footer3.align);
        doc.setPage(i);
        doc.text(
          param.pageLabel + " " + i + " / " + doc.getNumberOfPages(),
          docWidth - 20,
          doc.internal.pageSize.height - 6
        );
      }
```