barryvdh/laravel-dompdf:- fopen failed to open stream: No such file or directory in laravel 5.7

Mushfiqur Rahman Shaon picture Mushfiqur Rahman Shaon · Feb 1, 2019 · Viewed 10.4k times · Source

When I want to download invoice.pdf got error:-

fopen(project_path\storage\fonts/\071ddd89a9cb147bf5639344caee3fe8.ufm): failed to open stream: No such file or directory

enter image description here

After creating fonts folder under storage also got an error:

"execution times up" maximum execution time is 30 sec.

enter image description here

What should I do now?

Answer

Mushfiqur Rahman Shaon picture Mushfiqur Rahman Shaon · Mar 6, 2019

After testing all the way I got a perfect solution for "fopen faild" & "execution time expired".

It happens when you'll use your invoice code in extending the master file like

@extends('admin.master')
@section('body')
/* your invoice code*/
@sectionend

To avoid all issue just paste source code of your invoice in download invoice blade, like

<!doctype html>

    <html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>BigStore: Shopping Invoice</title>
    </head>
    <body>


    <style>
    /*css*/
    </style>
    <br>
    /**html code**/
     </body>
    </html>