Hi,
The attach invoice plugin is compatible with Joomla 4. The support for it was added 4 years ago in the plugin as you can see in its changelog:
www.hikashop.com/marketplace/product/18-plugin-pdf.html
I can see you purchased it in 2014, and in that case, you had access to updates for it until 2018, which is before we modified it to support Joomla 4 (since there was no information available to support Joomla 4 before then).
So you'll have to purchase it again to get access to the latest version and update the plugin on your website by installing the latest version's install package you'll be given access to after the purchase. This will fix that error.