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

frame --pdfpage-break: after; not working for multipage table #677

Open
cwaynedavis1946 opened this issue Mar 18, 2023 · 1 comment
Open
Labels
bug Something isn't working tables Issues with rendering tables

Comments

@cwaynedavis1946
Copy link

I'm a retired software engineer trying to develop a pdf meeting schedule on demand for a non profit. I wrote it first to create html then looked into converting the html to pdf. xhtml2pdf workd except for one problem. When the 4th frame is filled instead of a page break the 1st frame is overwritten and then a page break occurs. I added --pdfpage-break: after to the 4th frame but that didn't work. The documentation states that cells can't span pages but that's not happening. The rows are dynamic with variable height so breaking after a count won't work. The code is too long to include.

I'm creating the rows by:

row = f"<tr><td>{mtime}</td><td>{mgroup}</td><td>{mregion}</td></tr>"

This is the css:

@page {{ 
size: legal landscape;
    @frame col0 {{
        left: .4in;
        width: 3.3in;
        top:  .5in;
        height: 7.5in;
    }}
    @frame col1 {{
        left: 3.7in;
        width: 3.3in;
        top:  .5in;
        height: 7.5in;
    }}
    @frame col2 {{
        left: 7in;
        width: 3.3in;
        top:  .5in;
        height: 7.5in;
    }}
    @frame col3 {{
        left: 10.3in;
        width: 3.3in;
        top:  .5in;
        height: 7.5in;
        --pdfpage-break: after; 
    }}    
table {{
    table-layout: fixed;
    width: 3in;
    margin: 0;
    border: 0;
    border-collapse:collapse;
    font-family: "Ariel Narrow", sans-serif;
    font-size: 9pt;
    align: "left";
    valign: "top";
}}
tr {{
    column-span: none;
    padding:0;
    margin: auto;
    height: auto;
    break-inside: avoid;
}}
td  {{
    padding: .05in;
    word-wrap: break-word;
}}
@timobrembeck timobrembeck added tables Issues with rendering tables bug Something isn't working labels Mar 18, 2023
@timobrembeck
Copy link
Collaborator

@cwaynedavis1946 Thanks a lot for the report, I can reproduce this behavior.
Unfortunately, there is no active community maintaining this project, so if you want this problem to be fixed in the near future, you would have to provide a patch yourself.
I'd be happy to review any PRs, if you want to give it a try.

@timobrembeck timobrembeck changed the title frame --pdfpage-break: after; not working for multipage table frame --pdfpage-break: after; not working for multipage table Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tables Issues with rendering tables
Projects
None yet
Development

No branches or pull requests

2 participants