Category : dompdf

This is the Controller for pdf Scanpdf is the model use AppScanpdf; use IlluminateHttpRequest; use PDF; class PdfController extends Controller { public function create() { $data = [‘title’ => ‘Laravel 7 Generate PDF Example’]; $pdf = Scanpdf::loadView(‘pdf’); return $pdf->download(‘Nicesnippets.pdf’); } i tried everything but I still don’t know why this happens Sourc..

Read more

Thank you in advance I am generating PDF with barryvdh/laravel-dompdf laravel library, i am able to add dynamic code to add in PDF but how to add javascript or jquery code I tried like this $pdf = PDF::loadView(‘invoice’, compact(‘invoiceDetails’)); $pdf->setOptions([‘enable_javascript’, true])->setOptions([‘javascript-delay’, 13500])->save(public_path(‘invoice.pdf’)); invoice.blade.php looks like this (Just adding small code) <h2 class="h2">Summary<span id="demo_span"></span> </h2> <script ..

Read more

I am trying to generate a bill for my system in Laravel, for which I have created a blade with my bill format as below: <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Bill</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> <link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet"> <style type="text/css" media="all"> body { font-family: "Roboto", serif; font-size: 0.7rem; ..

Read more

i’m trying to convert html to pdf with dompdf its working fine but its not rendering table border. i checked out some solution like adding css inline but its not working though……………………………………………………………….. pdf_view template: <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>AbleCare | Invoice</title> <style> @page { size: A4; margin: 0; padding: 0; } </style> </head> ..

Read more

so far I’ve been struggling with this for a couple days, been use Puppeteer and Package from SpatieBrowsershotBrowsershot but stuck with this error Error Output: ================ (node:47700) ExperimentalWarning: The fs.promises API is experimental { TimeoutError: Navigation timeout of 30000 ms exceeded at Promise.then (C:laragonwwwabcdenode_modulespuppeteerlibcjspuppeteercommonLifecycleWatcher.js:106:111) name: ‘TimeoutError’ } and also have tried barryvdh/laravel-dompdf, the result is ..

Read more

I have to put images in my PDF, however the images cannot display, instead it display like image not found or type unknown There are two images that have to display: from public directory /default.png from Voyager settings Voyager::image(setting(‘admitcard.signature’)) Below are my code: $pdf = PDF::setOptions([‘isHtml5ParserEnabled’ => true, ‘isRemoteEnabled’ => true])->loadView(‘pdf’, compact(‘data’))->stream(); return $pdf->download($data->name.’-admit-card.pdf’); If ..

Read more

this is the function where i am trying to create the pdf public function generar_pdf(Request $request){ $num_cont_vale = $request->get(‘num_cont_vale’); $fecha_inicial = $request->get(‘fecha_inicial’); $fecha_final = $request->get(‘fecha_final’); $dni = $request->get(‘dni’); $num_patente = $request->get(‘num_patente’); $cod_obra = $request->get(‘cod_obra’); $origen = $request->get(‘origen’); $destino = $request->get(‘destino’); $material = $request->get(‘material’); ->whereHas(‘canteras’, function ($query) use ($material) { if($material){ $query->where(‘material’, ‘LIKE’, "$material"); } }) ..

Read more

Here is the function that I am trying to create the PDF public function generar_pdf(Request $request){ $num_cont_vale = $request->get(‘num_cont_vale’); $fecha_inicial = $request->get(‘fecha_inicial’); $fecha_final = $request->get(‘fecha_final’); $dni = $request->get(‘dni’); $num_patente = $request->get(‘num_patente’); $cod_obra = $request->get(‘cod_obra’); $origen = $request->get(‘origen’); $destino = $request->get(‘destino’); $material = $request->get(‘material’); ->whereHas(‘canteras’, function ($query) use ($material) { if($material){ $query->where(‘material’, ‘LIKE’, "$material"); } }) ..

Read more

I’m trying to generate pdf file with laravel-dompdf library. This is my font style I used: @font-face { font-family: ‘Hiragino Sans’; src: url(‘fonts/Hiragino Sans GB W3.ttf’) format(‘truetype’); font-weight: normal; } @font-face { font-family: ‘Hiragino Sans’; src: url(‘fonts/Hiragino Sans GB W6.ttf’) format(‘truetype’); font-weight: bold; } This is code in controller: return PDF::loadView(‘pdf.presaleorder’)->save(‘test.pdf’); Everything works, but pdf ..

Read more

I’m using laravel-dompdf to create pdfs within my Laravel app, but I can’t seem to get the static headers and footers to work. I’m using Laravel 5.8 and "barryvdh/laravel-dompdf": "^0.8.4", and I’ve tried the suggestions found below: What I’ve tried https://ourcodeworld.com/articles/read/687/how-to-configure-a-header-and-footer-in-dompdf https://laracasts.com/discuss/channels/general-discussion/dompdf https://github.com/dompdf/dompdf/issues/1190 Even if I literally copy and paste the following (borrowed from here) ..

Read more

I have 2 different fonts, one for normal font and another for bold. I’m trying to apply the bold font to the strong tag but this is ignored. I’ve defined the font like this: @font-face { font-family: boldFont; src: url(“{{ asset(‘fonts/main/font_bold.ttf’) }}”) format(‘truetype’); } @font-face { font-family: regularFont; src: url(“{{ asset(‘fonts/main/font_regular.ttf’) }}”) format(‘truetype’); } And ..

Read more

I am new in laravel please help me anyone when i make pdf then some time working properly but some time giving error ‘Trying to access array offset on value of type null’ in dompdf in laravel. i am using barryvdh/laravel-dompdf”: “^0.8.5 packege and laravel 5.8. and i am using summernote editor for save chapter ..

Read more

I am using dompdf with laravel. Wheni have to make PDF, i write the below code in controller. public function download() { $courseoffers = Courseoffer::all()->get(); $pdf = PDF::loadView(‘admin.courses.pdf’, compact(‘courseoffers’))->setPaper(‘a4′,’landscape’); return $pdf->download(‘courseoffer.pdf’); } Here, pdf.blade.php is a specific file. But i don’t want to use that. i want a specific portion of blade file to make ..

Read more

I’m doing a project in Laravel in which student’s certificate will be generated dynamically using Barryvdh DomPDF. This is my controller function: public function certPdfGenerate() { ini_set(‘memory_limit’, ‘-1’); $apply_id= input::get(‘id’); $get_certificate_data = DB::Connection(‘mysql1’)->table(‘tbl_apply_certificate’)->where(‘apply_id’,$apply_id)->first(); $get_certificate_id1 = DB::Connection(‘mysql1’)->table(‘tbl_apply_certificate’)->select(‘apply_certificate_id’)->where(‘apply_id’,$apply_id)->get()->toArray(); foreach ($get_certificate_id1 as $key) { $get_certificate_id = $key->apply_certificate_id; } $filename = $get_certificate_id.’.pdf’; DB::Connection(‘mysql1’)->table(‘tbl_apply_certificate’) ->where(‘apply_id’, $apply_id) ->update([‘apply_pdf’ => $filename]); $data1 ..

Read more