Why isn't this functionality in submitForm firing?
I googled the Mpdf library and it supports a string output. So you can use the string output to build a response and return it via $form_state:

use Symfony\Component\HttpFoundation\Response;

  public function submitForm(array &amp;$form, FormStateInterface $form_state) {
    $content = '%PDF-1.3...';
    $headers = [
      'Content-Type' =&gt; 'application/pdf',
    ];
    $response = new Response($content, 200, $headers);
    $form_state-&gt;setResponse($response);
  }