Category : dompdf

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

** fopen(D:EducationTop-UpMSS PROJECTLak DeranaLakderanastoragefonts//abeezee_normal_f57491852736fdda9bafd244b0200c90.ufm): Failed to open stream: No such file or directory ** This is my code $employeesdata=DB::table(’employees’) ->select(’employees.*’,’departments.departmentName’,’job_roles.rolename’,’hotel_chains.City’) ->join(‘departments’,’departments.id’,’=’,’employees.departmentID’) ->join(‘job_roles’,’job_roles.id’,’=’,’employees.jobRoleID’) ->join(‘hotel_chains’,’hotel_chains.id’,’=’,’employees.workingPlace’) ->where(’employees.id’,$id) ->get(); $salaryData = emp_salary::where([[’emp_id’,$id],[‘pay_status’,0]])->get(); $pdf = PDF::loadView(‘financial.paysheet’, compact(’employeesdata’,’salaryData’)); return $pdf->download(‘invoice.pdf’); Sourc..

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

I have an export class that worked on XLSX and CSV, but doesn’t work on PDF. It’s return: ErrorException Undefined array key 0 My class is: class InvoicesExport implements FromQuery, WithHeadings, WithEvents { public function headings(): array { return [ [‘First row’], [‘Second row’, ‘Second row’], ]; } public function registerEvents(): array { return [ ..

Read more

How can I check whether the pdf function does work or not, and how to attech the downloaded pdf with the sending email. Models/User public function sendAdminEmail($customer) { $pdf = PDF::loadView(‘pdfview’); $pdf->download(‘pdfview’); //attech the pdfview to this email Mail::to(‘[email protected]’)->send(new AdminRequestConfirmMail()); } pdfview.blade.php <html> … <h1>Testing</h1> </html> Sourc..

Read more

I am trying to generate a PDF that will contain Chinese characters using dompdf and hence I downloaded the font package and added the following code in my blade.php. @font-face { font-family: ‘simhei’; font-style: normal; font-weight: normal; src: url(‘{{base_path().’/public/fonts/’}}’simhei.ttf) format(‘truetype’); } body { font-family: ‘simhei’, ‘DejaVu Sans’, sans-serif; } Next, I tried the API again ..

Read more

I have 100+ items, items have diff data.I want to print n number of pdf with single click, each pdf can have n number of pages. I am using foreach and getting results but when item have 2000+ rows (1 page have 25 rows)then its getting timeout. Here is my code: $finalItems = array(‘1,2,3,4’,5,6,…………..); foreach($finalItems ..

Read more

$html="<html><head><title> Etiquettes </title> <meta http-equiv=’Content-Type’ content=’text/html; charset=utf-8’/> <style> </style> </head> <body>"; $html.="<table>"; foreach($repas_pdj as $pdj) { $html.="<tr>"; $html.="<td style=’width:60mm;height:30mm;border:solid 1px blue;’>".$pdj->id."</td>"; $html.="<td style=’width:60mm;height:30mm;border:solid 1px blue;’>".$pdj->id."</td>"; $html.="<td style=’width:60mm;height:30mm;border:solid 1px blue;’>".$pdj->id."</td>"; $html.="</tr>"; // $html.="<span class=’etq’>".$pdj->id."</span>"; } $html.="</table>"; $html.="</body></html>"; Hey friends, if some 1 know how can i increment every in this . **i want to get : ..

Read more

In laravel app I download generated pdf file into temp subdirectory, but I got error : The filename and the fallback cannot contain the "/" and "" characters. With code: $save_to_file = substr(Session::getId(), 0,20) . ‘-‘ . $filename_to_save; $save_to_file_full_path = $tmp_dest.$save_to_file; Log::info( varDump($save_to_file, ‘ -10 $save_to_file::’) ); Log::info( varDump($save_to_file_full_path, ‘ -1 $save_to_file_full_path::’) ); Excel::download(new HostelsByIdExport(array_keys($this->confirmActionModalHostelsList)), ..

Read more

Result public function Repas_etq() { $pdf = App::make(‘dompdf.wrapper’); $customPaper = array(0,0,595,842); $date=date(‘Y-m-d’); $repas_pdj = DB::table(‘fiche_repas’)->WHERE(‘date_planif’,$date)->WHERE(‘repas’,’LIKE’,"%".$_GET[‘repas’]."%")->get(); $html="<html><head><title>Etiquettes </title> <meta http-equiv=’Content-Type’ content=’text/html; charset=utf-8’/> <style> @page{ padding:0px;} span.etq { display: inline-block; width: 65mm; height: 30mm; border:solid 1px red; background-color: yellow; } </style> </head> <body>"; $html.="<div>"; foreach($repas_pdj as $pdj) { $html.="<span class=’etq’>".$pdj->id."</span>"; } $html.="</div>"; $html.="</body></html>"; $pdf->loadHTML($html); $pdf->setPaper($customPaper)->setWarnings(false)->Output(‘myfile.pdf’,’F’); return $pdf->stream(); ..

Read more

I have a word template and I modify it’s content then save it as pdf. I use DOMPDF to save the file. $PDFWriter = IOFactory::createWriter($Content,’PDF’); $PDFWriter->save($savePdfPath); But when I open it the header is not there. If I dd($PDFWriter) I can see the header: #phpWord: PhpOfficePhpWordPhpWord {#1299 ▼ -sections: array:1 [▼ 0 => PhpOfficePhpWordElementSection {#1493 ..

Read more

After many tries and and researches, I still can’t get the header and footer of my docx file after the conversion to PDF. I read many topics and looked at the issue on the github forum but didn’t find what I needed. I also tried with TCPDF and same result. $domPdfPath = base_path(‘vendor/dompdf/dompdf’); Settings::setPdfRendererPath($domPdfPath); Settings::setPdfRendererName(‘DomPDF’); ..

Read more