Library it´s:
composer require barryvdh/laravel-dompdf
i´m trying to create pdf in my app with laravel 10.20. I created my blade and all content it´s ok.
I have any rows, columns, etc and all my content when i access to route that i can show my blade, it´s ok.
In my controller i have this code:
$pdf = PDF::loadView('Pdfs.precontract', ['precontrato' => $personalDataPrecontract])
->setPaper('a4', 'landscape')
->setOption('zoom', 1.2)
->setOption('footer-center', '')
->setOption('footer-font-size', 5);
$pdf->set_base_path("/public/css/");
$path = public_path('/storage/pruebas');
$fileName = 'precontrato.pdf' ;
$pdf->save($path . '/' . $fileName);
$pdf->download($fileName);
My problem, it´s when i create my pdf with controller, not load my head styles. In my blade, i haver any includes (head, footer, etc) in my head, i have this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link type="text/css" media="all" rel="stylesheet" href="{{ asset('css/bootstrap.min.css') }}">
<link rel="stylesheet" href="{{ asset('css/style_pdf_pre.css') }}">
</head>
<body>
<header>
<div class="row justify-content-center align-items-center w-100 mt-3">
My bootstrap version it´s in PDFs, v4.6.2
i trayed with 3.3.7
, but i have same problem.
When generate my pdf, i can show it so.
I haven´t got rows.. columns...
Anybody can say me that i´m doing wrong? Thanks for readme and sorry for my bad english