Category : pdf

I want generate a pdf file to the customer that can edit it and then download it, I use Laravel 8, mpdf 0.8.15, niklasravnsborg/laravel-pdf 4.1 and php 7.4 I tried this code with mpdf package in controller : $html = file_get_contents(resource_path(‘views/app/pdf/inventory/inventory2.blade.php’)); $pdf = new MpdfMpdf(); $pdf = Mpdf::loadView(‘app.pdf.inventory.inventory2’); $pdf->useActiveForms = true; $pdf->WriteHTML($html); return $pdf->Output(); // ..

Read more

PDF file is not generated using barryvdh /laravel-dompdf ++ Controller public function bookingInvoicePdf($code) { $booking = Booking::where(‘code’, $code)->first(); $user_id = Auth::id(); if (empty($booking)) { return redirect(‘user/booking-history’); } if ($booking->customer_id != $user_id and $booking->vendor_id != $user_id) { return redirect(‘user/booking-history’); } $data = [ ‘booking’ => $booking, ‘service’ => $booking->service, ‘page_title’ => __("PDF Invoice") ]; $pdf = ..

Read more

I am trying to convert .doc file to .pdf file in Laravel using phpOffice library. File convert successfully, but images in word file are disappeared in pdf file. Have a look on code, What’s wrong here. $domPdfPath = base_path(‘vendor/dompdf/dompdf’); PhpOfficePhpWordSettings::setPdfRendererPath($domPdfPath); PhpOfficePhpWordSettings::setPdfRendererName(‘DomPDF’); //Load word file $Content = PhpOfficePhpWordIOFactory::load(public_path(‘result.docx’)); //Save it into PDF $PDFWriter = PhpOfficePhpWordIOFactory::createWriter($Content,’PDF’); $PDFWriter->save(public_path(‘new-result.pdf’)); ..

Read more

I’m using https://github.com/barryvdh/laravel-dompdf in my Laravel 8 application, However the custom font not working. Controller Code: public function generatePdf(ClientProject $project) { $data = $project; $pdf = PDF::loadView(‘client.projects.generate-pdf’, compact(‘data’)); return $pdf->stream(‘requirements.pdf’); } View file: https://pastebin.com/9RHVudLH Sourc..

Read more

So am trying to convert HTML to PDF. The table heads are showing but the fields from my database are not. Btw, I’m using barryvdh/laravel-dompdf. FUNCTION THAT TRIGGERS PDF CONVERSION public function admin_pdf() { $pdf = App::make(‘dompdf.wrapper’); $pdf->loadHTML($this->convert_admin_quest()); return $pdf->stream(); } FUNCTION FOR PDF CONVERSION function convert_admin_quest() { $quests = $this->get_admin_quest(); $output= ‘ <h1 align="center">QUESTS</h1> ..

Read more

i m using snappypdf and i managed to add an html footer to my file with this code in my Laravel controller: ->setOption(‘footer-html’, view(‘front.mail_templates.layouts.emailFooter’))->setOption(‘margin-bottom’,17) but now i want to add page numbering to it, and after looking i found this solution: ->setOption(‘footer-right’, "Page [page] of [toPage]") The problem is i want these two to appear ..

Read more

I have been using barryvdh/laravel-dompdf for pdf generation. My problem is that I want to use different background images on different pages which I can’t. One background image is displayed on all the pages. <div id="watermark"><img src="{{ public_path(‘pdf-backgrounds/’. $settings->pdf_background_image) }}" height="100%" width="100%"></div> Is there any solution to this? Sourc..

Read more