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

Detect end of page #1

Open
dek-odoo opened this issue Apr 14, 2020 · 2 comments
Open

Detect end of page #1

dek-odoo opened this issue Apr 14, 2020 · 2 comments

Comments

@dek-odoo
Copy link

Is there a way we can detect end of page ?

I want to have separate custom footers for all pages based on data on each page.
So footers will be different on all pages.

I see headers and footers are being parsed before the content.

@houzefa-abba
Copy link
Contributor

Hi

In footers per se I doubt you'd get anywhere; sure one can use dynamic py3o elements in headers/footers but can't match these against what each page is displaying.

A common use case is to iterate on a global list and add page breaks before ending loops, eg:

for="item in items"
item.xxx
<page break>
/for

You could add footer-ish content before these page breaks...

One note since you are asking on this github page - it hasn't been updated for a while; you want https://bitbucket.org/faide/py3o.template for the latest version.

@dek-odoo
Copy link
Author

Thanks @houzefa-abba for your reply,
But the length of items to display on a page can vary largely, like a line can be 10/1/5/15 lines long, so displaying x number of lines and then doing a page break would not work,

To give more idea, what I want to do is:
Printing an invoice with hundreds of invoice lines, each page should have amount total on the end of the page. (A page might be able to display 10 invoice lines or may be just 2 in some cases.)

Not sure if we can get line number or position in page where the line will be printed.

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