private function writeViewForImaging(InvoiceInterface $invoice, $storagePath)
    {
        $html = $this->htmlGenerator->generate($invoice);
        $storagePath = $storagePath ?: storage_path().'/framework';

        $this->files->put($path = $storagePath.'/'.$invoice->getId().'.pdf', $html);

        return $path;
    }