I'm trying to convert excel file directly to PDF with the help of PHPSpreadsheet. but got an error "Class 'Mpdf\Mpdf' not found", Here is my code:
<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Worksheet\PageSetup;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf;
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$reader->setReadDataOnly(true);
$spreadsheet = $reader->load("excel.xlsx");
// when I use this MPDF class, I'm getting an error Class \Mpdf\Mpdf not found
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf($spreadsheet);
$writer->save("excel.pdf");
Kindly Help with above code.
Thanks