[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] [FO] columns with borders


Subject: Re: [xsl] [FO] columns with borders
From: Kamal Bhatt <kbhatt@xxxxxxxxx>
Date: Tue, 22 May 2007 08:06:56 +1000

Eliot Kimber wrote:
Kamal Bhatt wrote:
Hi
I want to create a page with 2 columns and a border around the 2 columns. All I seem to get is a border around each column, but not both columns. I don't want to use tables.

The only way I can think to do this is to put the border contents within a block that turns on borders, e.g.:


<fo:flow>
  <fo:block border="black 1p solid">
    <!-- actual content of flow goes here -->
  </fo:block>
</fo:flow>

The main challenge here would be if you need to do column spanning--spanning blocks must be direct children of fo:flow.

Otherwise, columns are not something you can put borders on directly, since they are simply a side effect of layout.

About the only other solution I can think of would be to use either background graphic for the page or one of the edge regions with an extent that encompasses the extent of the body region and draw boxes that will then be overlaid by the column content. This would result in invariant column boxes on each page.

Cheers,

Eliot

OK, lets try this again

       <fo:simple-page-master
         master-name="A4-last"
         page-width="{$page_width}mm"
         page-height="{$page_height}mm"
         margin-top="{$margin_top}mm"
         margin-bottom="{$margin_bottom}mm"
         margin-left="{$margin_left}mm"
         margin-right="{$margin_right}mm">
         <fo:region-body
           margin-top="{$header_extent + 6}mm"
           margin-bottom="{$footer_extent}mm"
           margin-right="10mm"
           column-count="2"
           column-gap="15mm"
           region-name="itin-last" />
         <fo:region-before
           region-name="itin-before-rest"
           extent="{$header_extent}mm" />
         <fo:region-after
           region-name="itin-after"
           extent="{$footer_extent}mm"/>
       </fo:simple-page-master>

That is my page master, and here is my flow (reduced for brevities sake):
<fo:flow flow-name="itin-last">
<fo:block border-style="solid">
<fo:block border-style="none" margin-right="6mm" margin-left="6mm">
<fo:block color="#005F97" font-size="12pt" font-family="sans-serif" font-weight="bold" margin-bottom="3mm"
border-bottom-width="0.1mm" border-bottom-style="none" border-bottom-color="#005F97">
Terms and Conditions
</fo:block>
<fo:block font-size="9pt" font-family="sans-serif" color="#333">
<fo:block font-size="7pt" font-family="sans-serif">
<fo:block>/ Header Text: J000FOOT (usage: F) \</fo:block>
<fo:block>\ This text is supposed to be for booking series J000. /</fo:block>
<fo:block>*******************</fo:block>
<fo:block>Paper Ticket Footer</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>
<fo:block>*******************</fo:block>


</fo:block>
</fo:block>
</fo:block>
</fo:block>
</fo:flow>
Assuming there were enough blocks, I would get two columns each with its own border. What I want is one border encompassing both columns. I am using FOP 0.93


--
Kamal Bhatt


Current Thread