mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-10-08 04:46:26 +00:00
More cleanup PHPDoc according to PhpStorm
This commit is contained in:
@@ -16,27 +16,20 @@ $spreadsheet->getActiveSheet()->setPrintGridlines(true);
|
||||
$helper->write($spreadsheet, __FILE__, ['Xlsx', 'Xls', 'Html']);
|
||||
|
||||
// Export to PDF (mpdf)
|
||||
function mpdfCjkWriter(Mpdf $writer): void
|
||||
{
|
||||
/** @var callable */
|
||||
$callback = 'mpdfCjk';
|
||||
$writer->setEditHtmlCallback($callback);
|
||||
}
|
||||
$mpdfCjkWriter = function (Mpdf $writer): void {
|
||||
$mpdfCjk = function (string $html): string {
|
||||
$html = str_replace("'Calibri'", "'Calibri',Sun-ExtA", $html);
|
||||
|
||||
function mpdfCjk(string $html): string
|
||||
{
|
||||
$html = str_replace("'Calibri'", "'Calibri',Sun-ExtA", $html);
|
||||
return str_replace("'Times New Roman'", "'Times New Roman',Sun-ExtA", $html);
|
||||
};
|
||||
|
||||
return str_replace("'Times New Roman'", "'Times New Roman',Sun-ExtA", $html);
|
||||
}
|
||||
$writer->setEditHtmlCallback($mpdfCjk);
|
||||
};
|
||||
|
||||
$helper->log('Write to Mpdf');
|
||||
IOFactory::registerWriter('Pdf', Mpdf::class);
|
||||
/** @var callable */
|
||||
$callback = 'mpdfCjkWriter';
|
||||
$filename = __FILE__;
|
||||
//$filename = str_replace('.php', '.mdpf.php', __FILE__);
|
||||
$helper->write($spreadsheet, $filename, ['Pdf'], false, $callback);
|
||||
$helper->write($spreadsheet, $filename, ['Pdf'], false, $mpdfCjkWriter);
|
||||
|
||||
// Remove first two rows with field headers before exporting to CSV
|
||||
$helper->log('Removing first two heading rows for CSV export');
|
||||
|
||||
Reference in New Issue
Block a user