flyingsaucerproject / flyingsaucer

XML/XHTML and CSS 2.1 renderer in pure Java
Other
1.97k stars 553 forks source link

Running elements only rendered on last page #226

Closed DeMol-EE closed 9 months ago

DeMol-EE commented 9 months ago

Hello,

I want to use flying saucer to get rid of some other PDF generating library and I am really happy to see that it supports margin boxes and running elements! The margin boxes seem to be working fine as long as I stick to content: "..." but if I switch to running elements, like a div somewhere in the page with a class, which I give position: running(NAME) and then apply to a margin box using content: element(NAME), it appears that the div is only rendered on the final page instead of on every page.

Is this a possible bug or does it sound like I am doing something wrong?

asolntsev commented 9 months ago

@DeMol-EE I don't know the whole history of FlyingSaucer, but I assume that this feature is not implemented. In other words, FlyingSaucer currently doesn't support position: running(NAME).

Feel free to submit a pull request to implement this feature!

DeMol-EE commented 9 months ago

Thanks @asolntsev. The user guide mentions:

As of release R8, Flying Saucer includes a handful of features from the CSS 3 specification, which are particularly useful in printed output; these include named pages, margin boxes and running elements.

which is why I assumed it was implemented. Perhaps if I find time, I will see if I can submit a PR.

DeMol-EE commented 9 months ago

Based on this, I moved the running elements up in the html file, and it works. So I was doing something wrong :)

asolntsev commented 9 months ago

@DeMol-EE Thank you for sharing the information!