[ https://issues.apache.org/jira/browse/FOP-3153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17772564#comment-17772564 ]
Daniel Norberg commented on FOP-3153: ------------------------------------- Hi, I have also noted this problem and don't know about a workaround for your particular issue. It would be great if these items could be fixed related to span all blocks: * Keep rules on span all block should apply on preceding and following siblings, and vice versa keep rules on preceding and following siblings should affect the span all block, I don't know of any workaround for this that work satisfactorily. * Spacing rules should apply on preceding and following siblings and vice versa. For this, the workaround is to add padding. Here is a simple FO structure which shows how we would like it to work (assume that the simple-page-master enforces multi column layout): {code:java} <fo:flow> <fo:block> The spacing between this block and the span all-block should be 5mm due to the spacing rule, currently does not work. </fo:block> <fo:block span="all" keep-with-next.within-page="always" space-before="5mm" space-after="10mm"> THE SPAN ALL BLOCK </fo:block> <fo:block> This block is kept together with the span all-block due to the keep rule, currently does not work. The spacing between this block and the span all-block should be 10mm due to the spacing rule, currently does not work. </fo:block> </fo:flow>{code} A "funny" thing is that the keep rule works if the following sibling also has span = all. So this works: {code:java} <fo:flow> <fo:block span="all" keep-with-next.within-page="always"> Some text </fo:block> <fo:block span="all"> This block is kept on the same page as the preceding span all-block. </fo:block> </fo:flow>{code} I'm not sure if the latter case is actually a bug with respect to the intended behavior but from a user point of view it would be good if FOP could work as in my first code example. > "Keep-with-next" condition not fullfilled when span="all" is used on a block > ---------------------------------------------------------------------------- > > Key: FOP-3153 > URL: https://issues.apache.org/jira/browse/FOP-3153 > Project: FOP > Issue Type: Bug > Components: fo/block > Affects Versions: 2.8 > Reporter: Jorge Villar > Priority: Major > Attachments: 877404072.fo, editor - 2023-10-02T091356.171.pdf > > > Hello, > We have to generate a document with text in two columns, but headings need to > extend to both columns using span="all". The problem I am facing is that the > "keep-with-next.within-page" condition is set to "always" in all headings, > but this condition is not respected in the generated PDF, with headings being > at the end of the page, and the next element in the next page. Find attached > the sample .fo file and the generated PDF document. > If there is a workaround for this, it would be greatly appreciated to know. > Thanks in advance. -- This message was sent by Atlassian Jira (v8.20.10#820010)