Home > Blockchain >  How can i create Two fo:blocks side by side across the pages
How can i create Two fo:blocks side by side across the pages

Time:02-04

I need to create two fo:blocks side by side. I made it by using

<fo:region-body column-count="2">

and by second block I used:

break-before="column"

Unfortunately, when the content of the second block (right side) becomes too much and jumps to the next page, it is shown on the left side.

I want the content of the second block (right side) to stay on the right site of the page , no matter how much page it becomes. Is there any Possibility.

Here is a Screenshot from my pdf:

Image

Thanks a lot.

CodePudding user response:

It depends on which formatter you are using and whether the two columns need to parallel each other.

If you are using AH Formatter and each column fills with text without any of that text needing to be opposite corresponding text in the other column, then you can define a separate fo:region-body in your fo:simple-page-master that are sized like your columns and generate a separate fo:flow for the content of each column. This works because XSL 1.1 allows multiple fo:region-body (see https://www.w3.org/TR/xsl11/#fo_simple-page-master). This will not work well if you have titles that span across both columns.

If you are not using AH Formatter, then you could put everything in a two-column table, but it could look odd if both sets of text includes footnotes, because the footnotes would end up interleaved at the foot of the page. (You could work around this using AH Formatter, but it provides the multiple fo:flow solution anyway.)

If you are using AH Formatter and you need to keep chunks of text in the two columns next to each other and the chunks don't break across a page, then you could put each pair of chunks in a separate two-column fo:block-container. (Multi-column block containers are an extension.) If the chunks have footnotes, then you could either keep the footnotes in each fo:block-container or you could specify that the fo:region-body has two columns, make every fo:block-container span both columns, and direct the footnotes from each chunk to the foot of one column or the other.

Otherwise, you could put everything in a two-column table with each pair of chunks in a separate table row. Alternatively, you could make each pair of chunks a separate fo:table. If there's footnotes and you are using AH Formatter, then you could use the same workaround as for the fo:block-container approach.

CodePudding user response:

Thank u for ur Reply. But I could not solve that Problem yet.

I have now used <fo:container> and <fo:block>. But now the problem is that the text is not shown on the next page. I share a picture here, you can see that the text ends at the end of the page and doesn't go any further, although the text is still long.

PDF

Here i would like to show you the xsl-fo file too.

 <fo:page-sequence master-reference="my-page">
    <fo:flow flow-name="first" font-size=".75em">
        <fo:block-container
    absolute-position="fixed"
    bottom="4.0in"
    right="4.3in"
    left="0.5in"
    top="1.0in"
  >
    <fo:block width="7.0in" border-style="solid">
      :::::: Frist Block :::::::
    </fo:block>
  </fo:block-container>
      <fo:block-container
       absolute-position="fixed"
       bottom="4.0in"
       left="4.3in"
       top="1.0in"
       right="0.5in">
    <fo:block width="5.0in" border-style="solid">
      Second Block. Here should be lot of Text.Here should be many Pages.  
    </fo:block>
  </fo:block-container>
    </fo:flow>
 </fo:page-sequence>

Could You help me in this case please?

  •  Tags:  
  • Related