Zend certified PHP/Magento developer

Override Magento 2 Order Invoice PDF

I can not seem to override the Magento Invoice class.

I’ve created a module, installed it, enabled it.
I have the following in my di.xml file

< ?xml version="1.0"?>

    

I’ve run the following commands:

./bin/magento cache:flush
./bin/magento setup:di:compile

If I run dev:di:info, it shows my class as a preference…

$ ./bin/magento dev:di:info "MagentoSalesModelOrderPdfInvoice"

DI configuration for the class MagentoSalesModelOrderPdfInvoice in the GLOBAL area

Preference: DojoInvoiceBarcodesModelOrderPdfInvoice

Constructor Parameters:
+-------------------+-----------------------------------------------------+-----------------------------------------------------------------------+
| Name              | Requested Type                                      | Configured Value                                                      |

I can verify it’s not using my class because if I alter the Magento Invoice file, it reflects when I click print invoice.

I’ve checked all the logs, and there are no errors.

I’m not sure if I’m doing something wrong, if you can’t override this class, or need to override in a different way.

Magento version 2.3.2

Any help would be appreciated.