Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw horizontal line in fo-block?

Tags:

xsl-fo

i need to implement next layout:

enter image description here

here's my code:

<fo:block text-align="center">United Nations Organisation</fo:block>                
<fo:block border-top-style="solid" text-align="center">(organisation)</fo:block>        
<fo:block border-top-style="solid" text-align="center">(department)</fo:block>

but in fact the 2nd horizontal line is not drawn. how can i achieve that? what am i doing wrong?

Thanks in advance!

like image 721
user1178399 Avatar asked Nov 15 '13 16:11

user1178399


2 Answers

You can use fo:leader

<fo:block text-align="center">United Nations Organisation </fo:block>   
<fo:leader leader-pattern="rule" leader-length="100%" rule-style="solid" rule-thickness="2pt"/>             
<fo:block text-align="center" font-size="8pt" margin-top="1mm">(organisation)</fo:block>        
<fo:leader leader-pattern="rule" leader-length="100%" rule-style="solid" rule-thickness="2pt"/>
<fo:block text-align="center" font-size="8pt" margin-top="1mm">(department)</fo:block>
like image 183
Meiko Rachimow Avatar answered Oct 19 '22 05:10

Meiko Rachimow


You can play with the border-bottom-width and the border-bottom-style.

I changed the margin-top to match your example.

<fo:block 
  border-bottom-width="2pt" 
  border-bottom-style="solid" 
  border-bottom-color="black" 
  font-weight="bold" 
  text-align="center">
    United Nations Organisation 
</fo:block>            
<fo:block text-align="center" font-size="8pt" margin-top="1mm">
  (organisation)
</fo:block>        
<fo:block border-bottom-width="2pt" border-bottom-style="solid"margin-top="7mm">
</fo:block>
<fo:block text-align="center" font-size="8pt" margin-top="1mm">
  (department)
</fo:block>

Hope this helps.

like image 2
yanckst Avatar answered Oct 19 '22 06:10

yanckst