barryvdh / laravel-snappy

Laravel Snappy PDF
MIT License
2.63k stars 290 forks source link

Title not centering #463

Closed eskiesirius closed 2 years ago

eskiesirius commented 2 years ago

When I was using pdfdom, centering the title in page 1 works but when i switched to snappy.. the title isn't center anymore.. here is my html code..

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Report | Facebook.com | Now</title>

    <style type="text/css" media="all">
        body {
            font-family: Helvetica, sans-serif;
        }

        .clearfix {
            overflow: auto;
        }
        .page-break {
            page-break-after: always;
        }

        h1 {
            display: block;
            font-size: 2em;
            margin-block-start: 0.67em;
            margin-block-end: 0.67em;
            margin-inline-start: 0px;
            margin-inline-end: 0px;
            font-weight: bold;
        }

        .container {
            margin-left: 5%;
            margin-right: 5%;
        }
        .title {
            margin: 250px 0 250px 0;
            text-align: center;
        }
        .details {
            font-weight: bold;
        }
        .tags {
            font-size: small;
        }

        .ws-table-all {
            border-collapse:collapse;
            border-spacing:0;
            width:100%;
            margin-left: auto;
            margin-right: auto;
            display:table;
            border:1px solid #ccc;
        }
        .ws-table-all tr {border-bottom:1px solid #ddd}
        .ws-table-all tr:nth-child(odd) {background-color:#fff}.ws-table-all tr:nth-child(even){background-color:#E7E9EB}
        .ws-table-all td,.ws-table-all th {padding:8px 8px;display:table-cell;text-align:left;vertical-align:top;}
        /*.ws-table-all th:first-child, .ws-table-all td:first-child{padding-left:16px;}*/
        td {
            max-width: 300px;
            overflow: hidden;
            text-overflow: ellipsis;
            word-wrap: break-word;
        }

        #header,
        #footer {
        position: fixed;
        left: 0;
            right: 0;
            color: #aaa;
            font-size: 0.9em;
        }
        #header {
        top: 0;
            border-bottom: 0.1pt solid #aaa;
        }
        #footer {
        bottom: 0;
        border-top: 0.1pt solid #aaa;
        }
        .page-number:before {
            content: "Page " counter(page);
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="title">
            <h1>Shield Report</h1>
            <span class="lead">www.facebook.com</span><br/>
            <span class="lead">Date: Now</span>
        </div>

        <div class="clearfix page-break"></div>

        <div class="row">
            <h3>Summary</h3>
            <hr />
            <h4>Total Attack Blocked: 10</h4>
            <h4>Top 10 IP Sources</h4>
            <div class="justify-content-center">
                <table class="ws-table-all">
                    <tr>
                        <th>#</th> <th>IP</th> <th>Country</th> <th>Blocked</th>
                    </tr>

                </table>
            </div>
        </div>
        <div id="footer">
            <div class="page-number"></div>
        </div>

        <div class="page-break"></div>

        <div class="row">
            <h3>Technical</h3>
            <hr />
        </div>

        <div class="row">

            <table class="ws-table-all">
                <tr>
                    <th>#</th> <th>Timestamp</th> <th>Details</th>
                </tr>

            </table>

        </div>
    </div>

</body>
</html>
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/KnpLabs/snappy instead. When having doubts, please try to reproduce the issue with just snappy. If you believe this is an actual issue with the latest version of laravel-snappy, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.