Category : pdf-generation

I currently using barryvdh/laravel-dompdf for printing pdf. But whenever I click on the print button it always downloads the file instead of opening a browser tab. How I can fix this ??? I’ve seen others post but I didn’t get the right solution too. $customer = Customer::findOrFail($id); $pdf = PDF::loadView(‘pdf.info-print’, $customer); return $pdf->stream(‘info.pdf’); Sourc..

Read more

I’m having trouble with Vue.js and Axios to fetch pdfs in my Laravel app. When ever a user clicks this button: <a @click="fetchData()"><i class="fas fa-file-download mouse-pointer"></i></a> My fetch method is being called in Vue.js: methods: { fetchData() { axios.get(this.fetchUrl, {responseType: ‘arraybuffer’}) .then(response => { let blob = new Blob([response.data], { type: ‘application/pdf’ }) let link ..

Read more

I was working on a laravel project on windows using xampp but switched to ubuntu after, my pdf generation code suddenly broke without any changes. I installed laravel-snappy and pointed it to the wkhtmltopdf paths but suddenly headers and footers are not getting rendered. This is my controller code public function createPDF(){ $userData = $this->getUserData(); ..

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