How can I build an invoice data extractor tool for free?

I want to build an invoice extractor for free , in which I can get desired details when I upload my invoice pdf, in a JSON format, I have tried many things like hard code approach, pre trained models on hugging face , docling , donut and layoutlmv3 too , but I am not getting accurate results , the structure and contents of my invoices are different.
If anybody can help me it would be great.

Welcome to the forum!

Disclosure: I have not used the following, but reading it should give you some ideas. Also the tools noted are not publicly available AFAIK.

Also consider:

OpenAI Prompt optimizer

HTH