Default rename the downloaded pdf

The generated pdf has a default download name scheme which is “Invoice_12345”. This is the name it automatically gives your pdf when you go to download it. I would like to change the Invoice word. I’ve searched and searched and only found this in /var/www/html/invoiceplane/application/helpers/pdf_helper.php but it has the i in invoice lowercase so I doubted it was the correct spot to make a change. See code area below. Anyone know where to change this?

$filename = trans('invoice') . '_' . $invoice->invoice_number . '_' . $shortsum;

It is the correct spot.
see this?:

trans('invoice')

That ‘invoice’ is probably translated to “Invoice”.

Give it a try and change it to what you want.

I did try but saw no changes in new invoices. Restarted apache2 just in case as well.

 $filename = trans('TEST') . '_' . $invoice->invoice_number . '_' . $shortsum;
1 Like

Found the answer when surfing through the pdf_helper.pdf. This is the correct line to edit. Unsure what the other line is for then.

return pdf_create($html, trans('TEST') . '_' . str_replace(array('\\', '/'), '_', $invoice->invoice_number),
1 Like

hello @pingdoug ,
As @UnderDog already indicated, the word “invoice” is translated to the language set for the user.
In pdf_helper.php, the prefix "trans(invoice)_" will be added to "filename".
The place where the composed “filename” is formatted is in mpdf_helper.php.
See screenshot.

Please note that if you change this, it will be overwritten with every IP upgrade.

2 Likes