flyingsaucerproject / flyingsaucer

XML/XHTML and CSS 2.1 renderer in pure Java
Other
2.02k stars 565 forks source link

Broken page headers in version 9.11.0 #447

Closed rzam closed 4 days ago

rzam commented 5 days ago

Page headers seem to be missing/broken in version 9.11.0.

Minimal HTML example:

<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <style>
            @page {
                size: 200px 200px;
                @top-left { content: element(header); }
                @bottom-left { content: element(footer); }
            }

            #header {
                position: running(header);
            }

            #footer {
                position: running(footer);
            }
        </style>
    </head>

    <body>
        <div id="header">Header</div>
        <div id="body">Body</div>
        <div id="footer">Footer</div>
    </body>

</html>

This is how it was rendered up until version 9.10.2:

image

This is how it is rendered in version 9.11.0:

image

asolntsev commented 4 days ago

For the record, it was broken in commit 582fbb0b ("#429 [refactor] make class PageRule almost immutable"). In the previous commit b3deb2ca ("#429 [refactor] make class PDFEncryption immutable"), the header was visible.

PR https://github.com/flyingsaucerproject/flyingsaucer/pull/450 fixes the problem.

asolntsev commented 4 days ago

@rzam FlyingSaucer 9.11.1 has been release. Can you please check if it solves the problem?

rzam commented 4 days ago

@rzam FlyingSaucer 9.11.1 has been release. Can you please check if it solves the problem?

Works on my end. Cheers!