csspdf-generationlaravel-5.4wkhtmltopdflaravel-snappy

Laravel snappy(^0.3.3) - Not able to include css style, image


I'am using laravel/snappy package(https://github.com/barryvdh/laravel-snappy)for pdf generation in my laravel 5.4 project.

Unless including css files everything working fine.

when i include a css file , i'am getting time out error. Many references suggest to set timeout.

$pdf = PDF::loadView('job-seeker.profile.partials.resume-pdf', ['jobseeker' => $jobseeker])->setTimeout(3600);
return $pdf->download($jobseeker->name . '-resume.pdf');

to override the default 60. But when i set timeout like this or either in config, I'am getting this error.

Call to a memeber function download() on null

The localhost:8000 path is not getting detected to load the css file.

Already given answers not solving my issue... https://github.com/barryvdh/laravel-snappy/issues/129,https://github.com/barryvdh/laravel-snappy/issues/16 etc...


Solution

  • I'am using inline styling rather than including external css file.