I will tell what i have done till now.
I have made a custom module to override the
file and its working fine.
I am able to get sku, name, price in the invoice pdf in any location. Now i am trying to get the product object inside it to get custom attribute values.
Most of the tutorials i found is advised to use objectmanager that i am not interested in looking into. Rather i need to include those via factory or repository.
my question is how we can get product object inside model file(for example defaultinvoice.php file).