如何使用 play pdf 在同一 pdf 文档中创建单独的页面

how to create separated pages in same pdf document using play pdf

我在我的应用程序中使用 play2-pdf 生成 pdf 我首先创建了封面,但是当我尝试添加其他页面时,它已添加到同一个 pdf 页面中,我如何在同一个 pdf 中创建多个页面我也在尝试在第一页添加页脚,但仍然有同样的问题

<html>
    <head>
        <style>
        p.serif {
        font-family: "Times New Roman", Times, serif;
        }
        p.sansserif {
        font-family: Arial, Helvetica, sans-serif;
        }
        </style>
    </head>
    <body>
        this is a test
        <div style="position:absolute; bottom:0;right:0;margin:24px;">by bSuccess</div>
    </body>
</html>

对于页眉和页脚,您可以使用 css 分页媒体模块 (https://www.w3.org/TR/css3-page/)

示例:

<html>
    <head>
        <style>
            @@page {
                @@bottom-right {
                    content: "by bSuccess";
                    font-size: 14px;
                }
            }
        </style>
    </head>
    <body>
        this is a test
    </body>
</html>

对于分页符,您可以使用 css 分页符属性 (https://css-tricks.com/almanac/properties/p/page-break/)

示例:

<html>
    <head>
        <style>
            @@page {
                @@bottom-right {
                    content: "by bSuccess";
                    font-size: 14px;
                }
            }
        </style>
    </head>
    <body>
        <div>this is a test</div>
        <p style="page-break-after:always;"></p>
        <div>testing page break</div>
    </body>
</html>