Barcode on Sales Invoice with Invoice number

I would like to print a barcode containing the invoice number (doc.name) on all invoices. I was successfully able to add the barcode field. But have no clue how to automatically fetch doc.name into the barcode.

We maintain a scanned copy of invoices signed and sealed by our customers. If there is a barcode on the invoice it can automatically be organized or renamed at the time of scanning using any OCR.

Hi, Did you solve this out? Or want me to help you out ?