add test batches
This commit is contained in:
@@ -8,7 +8,9 @@ use Dompdf\Options;
|
||||
|
||||
class SlipPrinterPdfService
|
||||
{
|
||||
public function __construct(private SlipPrinterConfigService $configService) {}
|
||||
public function __construct(private SlipPrinterConfigService $configService)
|
||||
{
|
||||
}
|
||||
|
||||
public function render(array $data, array $lines, array $options = []): array
|
||||
{
|
||||
@@ -61,7 +63,7 @@ class SlipPrinterPdfService
|
||||
'h_mm' => $hMm,
|
||||
]);
|
||||
|
||||
$optionsObj = new Options;
|
||||
$optionsObj = new Options();
|
||||
$optionsObj->set('isRemoteEnabled', true);
|
||||
$optionsObj->set('defaultFont', 'Courier');
|
||||
|
||||
@@ -74,7 +76,7 @@ class SlipPrinterPdfService
|
||||
$dompdf->setPaper([0, 0, $wPt, $hPt]);
|
||||
$dompdf->render();
|
||||
|
||||
$filename = 'LateSlip_'.preg_replace('/[^A-Za-z0-9]+/', '_', (string) ($data['student_name'] ?? 'slip')).'_'.date('Ymd_His').'.pdf';
|
||||
$filename = 'LateSlip_' . preg_replace('/[^A-Za-z0-9]+/', '_', (string) ($data['student_name'] ?? 'slip')) . '_' . date('Ymd_His') . '.pdf';
|
||||
|
||||
return [
|
||||
'content' => $dompdf->output(),
|
||||
|
||||
Reference in New Issue
Block a user