I think the best approach is to overwrite the view/frontend/layout/sales_order_printinvoice.xml
layout file in your custom theme and change the line:
<block class="Magento\Sales\Block\Order\Invoice\Totals" name="invoice_totals" template="Magento_Sales::order/totals.phtml" cacheable="false">
so that it uses a custom block class, then create this custom block class in your module and make it inherit the Magento\Sales\Block\Order\Invoice\Totals
class, then override the _initTotals()
method like this:
protected function _initTotals()
{
parent::_initTotals();
$this->removeTotal('subtotal');
return $this;
}
You probably already saw that the totals used in invoice pdf are used in other invoice related functionalities and that they are registered programmatically on the PHP side. My suggestion described above is to leave the other functionalities untouched while adding your customization only in the area of interest (so no preference, plugin or manual validations in the phtmls).
Good luck!