mPDF temporary file is not writable

Use php tmp with try

        try {
        $mpdf = new Mpdf([
            'tempDir' => '/tmp', // uses tmp to store PDF
        ]);
      } catch (\Mpdf\MpdfException $e) {
            // Return 500 if mPDF fails to create instance 
            $response->setMessage("Creating an mPDF object failed with" . $e->getMessage());
            $response->setStatusCode(500);
            return $response;
    }

Você achou esse artigo útil?