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

print sum of a table column to next page #1592

Closed
ritiksoni00 opened this issue Mar 10, 2022 · 2 comments
Closed

print sum of a table column to next page #1592

ritiksoni00 opened this issue Mar 10, 2022 · 2 comments

Comments

@ritiksoni00
Copy link

ritiksoni00 commented Mar 10, 2022

If you call .render() on an HTML object, you get a Document object whose .pages attribute is a list of Page objects. You can shuffle this list all you want before calling e.g. .write_pdf() on the document, without modifying the layout code. I suppose you could use the pages’ anchors attribute to check which page contains a given element, if you give it an ID: e.g. <h2 id=toc> and if 'toc' in page.anchors: ...

See details in the documentation: http://weasyprint.org/docs/api/

So yeah, I suppose we could add limited support for target-counter() that only works if the target is earlier in the document, then you could have a TOC at the end and shuffle pages to put it at the beginning again. I guess you’d want something like @page :first { counter-reset: page 2 }, not sure if that works right now. Maybe named pages (#57) would be useful there as well.

This sounds reasonable. It’s just a matter of someone doing the work now. Unfortunately nobody is actively working on WeasyPrint at the moment.

Originally posted by @SimonSapin in #23 (comment)

if 'toc' in page.anchors: ... is doing weird behavior, putting some random values in that particular element.

i want to achieve something like this

Screenshot from 2022-03-08 14-26-52

@liZe
Copy link
Member

liZe commented Mar 12, 2022

Hello,

That’s a duplicate of #1201, and unfortunately there’s no good solution to this problem :/.

@liZe liZe closed this as completed Mar 12, 2022
@ritiksoni00
Copy link
Author

hey lize,
Thanks for pointing out the duplicate. and I hope we can get it in the future.

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

No branches or pull requests

2 participants