Including Bootstrab not working
Opened this issue · 0 comments
Adi-18 commented
I run in PHP 8.2.21, Symfony: 7.0.10
When I use "%kernel.project_dir%/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64" the Bootstrab has no effect.
When I use xvfb-run wkhtmltopdf Bootrstrab is processing correctly.
Code:
Controller
$html = $this->renderView('pdf/pdf_report.html.twig', $parameters);
$content = $knpSnappyPdf->getOutputFromHtml($html, [
'margin-top' => 20,
'margin-bottom' => 15,
'margin-left' => 10,
'margin-right' => 10,
]);
pdf_base.html.twig
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ siteInfo.title }}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{ absolute_url(asset('assets/bootstrap-5.1.3/css/bootstrap.css')) }}" rel="stylesheet" type="text/css">
</head>
<body>
<div class="mx-auto" style="width: 100%;">
<div class="container">
{% block title %}
<h2 style="text-align: center;">{{ siteInfo.title }}</h2>
<h3 style="text-align: center;">{{ siteInfo.subTitle }}</h3>
{% endblock %}
{% block body %}{% endblock %}
</div>
</div>
</body>
<style>
table th {
background: rgb(224, 224, 255);
text-align: left;
}
</style>
</html>