Adding Custom Fields to PDF

Hi @Kovah,

Hope you are well.

Since upgrading to the latest version, it has now broken my custom PDF templates.

Seems that its the Custom Fields that are causing the issue.

Can you show me an example of how to add the custom fields using the new template.

Thanks
Dale

It is all discribed in the wiki: https://wiki.invoiceplane.com/en/1.5/templates/customize-templates#custom-fields

@Kovah, Thank you for the link; But it does not seem to be helping on the PDF for the Custom Fields.
I use like this as shown below, but it does not display the Value of the Custom Field, instead throws an error.
Request to please suggest/help on this.
I am using Invoice Plane 1.5.2

<?php $custom_fields['User']['PanID'] ?></b>

Error it prints on PDF is:

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: custom_fields
Filename: pdf/InvoicePlane.php
Line Number: 33
Backtrace:
File:
/home/webki6se/public_html/invoicer/applicatio
n/views/invoice_templates/pdf/InvoicePlane.php
Line: 33
Function: _error_handler
File:
/home/webki6se/public_html/invoicer/applicatio
n/third_party/MX/Loader.php
Line: 404
Function: include
File:
/home/webki6se/public_html/invoicer/applicatio
n/third_party/MX/Loader.php
Line: 365
Function: _ci_load
File:
/home/webki6se/public_html/invoicer/applicatio
n/helpers/pdf_helper.php
Line: 75
Function: view
File:
/home/webki6se/public_html/invoicer/applicatio
n/modules/invoices/controllers/Invoices.php
Line: 280
Function: generate_invoice_pdf
File:
/home/webki6se/public_html/invoicer/index.php
Line: 327
Function: require_once

Just realized after reading the code over and over again after a good night sleep and some coffee.
I had not echo-ed the values out, to add to the entertainment, I had a typo in it as well.
Corrected as below and it works like a charm. Thank you @Kovah for the clean documentation.
<?php echo $custom_fields['user']['PanID'] ?>

1 Like