Forum Feature requests

Support for generated content in @page-float-top and @page-float-bottom

Paul Mansour
I know that currently generated content is not supported for @page-float-top and @page-float-bottom regions:

https://www.princexml.com/forum/topic/4614/use-of-page-float-bottom

If this were supported would it solve the following problem:

I am currently displaying page headers and footers using the @page-top and @page-bottom regions. The content and the styling of the headers and footers are user-defined and thus vary, so the the user must experiment with the top and bottom margins of the page in order create just enough room in the margin boxes to display the content.

If the @page-float-top and @page-float-bottom placed generated content at the top and bottom of the page within the page area, that is inside the margins, it seems like it might solve my problem (no need to experiment with margins), and also leave margin boxes free for system generated content, rather than user generated content.

Is this the purpose or appropriate usage of these regions?
Paul Mansour
I should add that by "generated content" I mean content that I am taking out of flow of the document and placing in the margin regions.
howcome
Prince doens't support the @-name you use above. However, we support running headers and footers with the @page construct.

Here's a guide: https://css4.pub/2022/running-headers/

And, we support page floats: https://css4.pub/2022/floats

Given your last comment, I would probably start by looking at running elements:

https://css4.pub/2022/running-headers/#running-elements

Edited by howcome

Paul Mansour
Thanks. I already have that solution using running headers and footers, and it works very well with one minor exception. The height of the content is user defined and is not known ahead of time, so the user must fiddle with the top and bottom page margins the first time to see how big they should be. Not a huge deal.

My questions was IF @page-float-top and @page-float-bottom regions were supported, would they solve this problem? In other words, what is their intended use?
howcome
I don't recall anyone proposing, nor defining @page-float-top, so I can't comment on their intended use. This is not something Prince supports, even if someone asked about it in the thread you refer to.

You can float elements to the top of a page with:
float: top

However such elements will not repeat on every page, which is what you're after?

Edited by howcome

Paul Mansour
The only reason I asked about this was because when researching I saw this table in the Prince docs:

https://www.princexml.com/doc/paged/#page-regions

which mentions @page-float-top and @page-float-bottom. This reference, in combination with the thread where it where it was mentioned they are not supported, led me to believe they were in the spec, just not supported by Prince. If that is not the case, no worries.

However such elements will not repeat on every page, which is what you're after?


Yes, that is correct. As I noted, its not a huge a deal, I was just curious if there was some unimplemented aspect of the spec that would have solved my issue.

Edited by Paul Mansour

csant
which mentions @page-float-top and @page-float-bottom.


They are indeed supported, and the only way to populate them is by content that needs to be provided in the document.

Some more details will be in the documentation for the next majour Prince release (it will be better styled when it will be live ;) )

Here also a graphic representation of where the various page regions are.



All "normal" document content will go inside the various regions - thus 'float: top' will be positioned right under @page-float-top.
  1. marginboxes-1.colour.png97.7 kB
    Page regions

Edited by csant

howcome
I stand corrected, Prince indeed has a notion of @page-float-top, even if it's not exposed in the CSS syntax.

Presumably, it could be exposed at some point, and the use case provided by Paul is compelling.

Edited by howcome