Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including Bootstrab not working #51

Open
Adi-18 opened this issue Jul 28, 2024 · 0 comments
Open

Including Bootstrab not working #51

Adi-18 opened this issue Jul 28, 2024 · 0 comments

Comments

@Adi-18
Copy link

Adi-18 commented Jul 28, 2024

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant