Category : pdf

I used BarryvdhDomPDF package to export invoice in pdf format. It is working fine in localhost, but when I updated it on the server, its showing me the error below: Class ‘BarryvdhDomPDFServiceProvider’ not found I updated the config/app.php file with: ‘providers’ => [ BarryvdhDomPDFServiceProvider::class, ], ‘aliases’ => [ ‘PDF’ => BarryvdhDomPDFFacade::class, ], Even I deleted ..

Read more

I use barryvdh/laravel-snappy to generate pdf and need to create a signature area in my pdf doc. There must be two signature fields because it’s a contract pdf but when I use css grid or flex they place one under the other. How to place them side by side? <div class="flex-container" style=" display:flex; padding: 10px;"> ..

Read more

please help me. I have an application that loads a pdf file from a shared folder. but i found a problem with security in browser. I’ve tried adding a header reference to the app with middleware: $response = $next($request); $response->header(‘X-Frame-Options’, ‘DENY’); return $response; and setting .htacces: <IfModule mod_headers.c> # Prevent click jacking Header set X-Frame-Options ..

Read more

I’m using BarryvdhDomPDF export data from laravel webpage into pdf. But I’m getting ‘Maximum execution time of 60 seconds exceeded’ picture of error in app.php I already set Barryvdh class and aliases as PDF in web.php Route::get(‘/Student/Materi/singleMateri/exportPdf/{id}’, ‘[email protected]’)->middleware(‘role:Student’); in StudentController.php public function exportPdf($id) { $singleMateri = Materi::findOrFail($id); $pdf = PDF::loadview(‘pages.student.materi.exportPdf’, compact(‘singleMateri’) ); return $pdf->download(‘materi.pdf’); } ..

Read more

By using laravel-pdf, I am trying to make print page which includes Korean. Html view page works fine but once converted it to pdf and stream, Only Korean part shows like ???? controller namespace AppHttpControllers; use AppHttpControllersController; use PDF; class TestController extends Controller { public function pdf(){ $pdf = PDF::loadView(‘pdf_view2’); return $pdf->stream(); } public function ..

Read more

I have a view welcome.blade.php with the headear like this: <!DOCTYPE html> <html lang="{{ str_replace(‘_’, ‘-‘, app()->getLocale()) }}"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Blog</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <link href="{{ asset(‘css/app.css’) }}" rel="stylesheet" media="print"> <link href="{{ asset(‘css/example.css’) }}" rel="stylesheet" media="print"> <link rel="preconnect" href="https://fonts.gstatic.com"> </head> <body class="font-sans antialiased w-full"> …. I’m using tailwindcss, this page has ..

Read more

i´m traying to extract text from my PDF with class PDF2Text or spatie/pdf-to-text but i can´t to do… i´m traying first with: PDF2Text if($request->file(‘adjunto’) != ""){ $fileName = $request->file(‘adjunto’)[0]->getClientOriginalName(); $ext = pathinfo($fileName, PATHINFO_EXTENSION); $name = $fileName; $result = $request->file(‘adjunto’)[0]->storeAs(‘importaciones’, $name, ‘public’); $route = public_path(‘storage/importaciones/’.$name); }else{ return "Error al subir fichero, consulte al administrador del sistema"; ..

Read more

$lineStyle = array( ‘color’ => $tag[‘fgcolor’], ‘cap’ => $tag[‘style’][‘cap’] , ‘join’ => $tag[‘style’][‘join’] , ‘dash’ => $tag[‘style’][‘dash’] , ‘phase’ => $tag[‘style’][‘phase’] , ); $tag[‘style’][‘cap’] undefined index: cap Sourc..

Read more

I’m new to Laravel and I’m currently working on a web application in localhost. I heard that if you want to make files publicly accessible you should store them in the public folder inside the storage. This is my code for storing (for example test.pdf): $filename = $request->filename; $file = $request->file; file_put_contents(storage_path(‘apppublic’).’uploadsclients12".$filename, file_get_contents($file)); In my ..

Read more

Below is my Laravel function for generating a waybill from the courier provider. Currently, the code is working fine but the waybill pdf is directly open in the browser. How do I force it to download the pdf? public function awb(Request $request) { function e($str) {print'<pre>’;print_r($str);print'</pre>’;} $url = ‘http://web.com/print/print.action’; $key = $request->key; $billCode = $key; ..

Read more