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

PHP Warning with fixed header and footer without positional properties #828

Closed
jukka-p opened this issue Aug 8, 2018 · 0 comments
Closed

Comments

@jukka-p
Copy link

jukka-p commented Aug 8, 2018

Discovered in #791: Warning: Division by zero at Mpdf.php:16063

Code to reproduce with v7.1.3:

$mpdf = new Mpdf(['mode' => 'utf-8', 'format' => 'A4']);
$mpdf->WriteHTML('
    <html>
        <head>
            <style>
                @page {
                    header: html_myHeader;
                    footer: html_myFooter;
                }

                .fixed-position {
                    position: fixed;
                }
            </style>
        </head>
        <body>
            <htmlpageheader name="myHeader">
                <div class="fixed-position">FIXED HEADER</div>
            </htmlpageheader>

            <htmlpagefooter name="myFooter">
                <div class="fixed-position">FIXED FOOTER</div>
            </htmlpagefooter>
        </body>
    </html>'
);

My first impression was that overlapping header and footer cause a warning, but by adding top: 0; to the class, the warning goes away and both elements are happily positioned at the same place.

So not a bug that will affect anything, just a baffling warning for anyone encountering this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants