Please take a look at https://github.com/InvoicePlane/InvoicePlane/blob/master/application/helpers/pdf_helper.php#L62