diff --git a/app/Services/QrStickerService.php b/app/Services/QrStickerService.php index ab235c7..36721a3 100644 --- a/app/Services/QrStickerService.php +++ b/app/Services/QrStickerService.php @@ -85,16 +85,16 @@ class QrStickerService */ private function generatePdf(Order $order, string $qrUrl): string { - // Generate inline QR code as SVG + // Generate QR code as base64-encoded PNG (DomPDF handles this better than SVG) $options = new QROptions([ - 'outputType' => QRCode::OUTPUT_MARKUP_SVG, + 'outputType' => QRCode::OUTPUT_IMAGE_PNG, 'eccLevel' => QRCode::ECC_H, - 'scale' => 4, - 'imageBase64' => false, + 'scale' => 8, + 'imageBase64' => true, ]); $qrCode = new QRCode($options); - $qrSvg = $qrCode->render($qrUrl); + $qrBase64 = $qrCode->render($qrUrl); // Determine order type $orderType = $order->type === 'standard' ? 'STOCK ORDER' : 'CUSTOM ORDER'; @@ -111,15 +111,14 @@ class QrStickerService $nameParts = explode(' ', trim($customerName)); $customerSurname = end($nameParts); - // Build HTML directly (no view file dependency) - $html = << + // Build HTML with proper SVG embedding (avoid heredoc issues) + $html = '
@@ -231,49 +227,47 @@ class QrStickerService