barryvdh / laravel-dompdf

A DOMPDF Wrapper for Laravel
MIT License
6.74k stars 971 forks source link

QR code not show invoice downloaded file #862

Closed vishaldamasiya closed 2 years ago

vishaldamasiya commented 2 years ago

my QR code in pdf file

image


and invoice pdf download in not show QR code

controller code

use SimpleSoftwareIO\QrCode\Facades\QrCode;

public function print($id) { $invoice = $this->invoiceRepository->findOrFail($id); $html = view('admin::sales.invoices.pdf', compact('invoice'))->render();

return PDF::loadHTML($this->adjustArabicAndPersianContent($html)) ->setPaper('a4') ->download('invoice-' . $invoice->created_at->format('d-m-Y') . '.pdf'); }

private function adjustArabicAndPersianContent($html) { $arabic = new \ArPHP\I18N\Arabic();

$p = $arabic->arIdentify($html);

for ($i = count($p) - 1; $i >= 0; $i -= 2) { $utf8ar = $arabic->utf8Glyphs(substr($html, $p[$i - 1], $p[$i] - $p[$i - 1])); $html = substr_replace($html, $utf8ar, $p[$i - 1], $p[$i] - $p[$i - 1]); } return $html; }

but download invoice pdf in not Show QRcode