cacheDirectory = $cacheDirectory; } /** * @param string $html * @return mixed|string * @throws \Mpdf\MpdfException */ public function convertToPdf(string $html) { $mpdf = new Mpdf(['tempDir' => $this->cacheDirectory]); $mpdf->creator = Constants::SOFTWARE; $mpdf->WriteHTML($html); return $mpdf->Output('', Destination::STRING_RETURN); } }