Closed vishaldamasiya closed 2 years ago
my QR code in pdf file
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);
but download invoice pdf in not Show QRcode
my QR code in pdf file
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