You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by MaheshR <ma...@gmail.com> on 2009/06/04 21:26:20 UTC

How to draw vertical line between columns in region body

HI,

In fo:region-body level that we can define column-count for a page, and
using this we can implement a functionality that if text overflow in first
coumn it will automatically flow to next column.

My problem is that if I have span="none", I want to draw vertical line
between columns. 
Any suggestions on this would be greatly helpful.

Thanks
Mahesh
-- 
View this message in context: http://www.nabble.com/How-to-draw-vertical-line-between-columns-in-region-body-tp23876172p23876172.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: How to draw vertical line between columns in region body

Posted by Mahesh Rayudu <ma...@gmail.com>.
Hi Pascal,

 Appreciate your help. Thank you.Its working perfect.

Thanks
Mahesh

On Fri, Jun 5, 2009 at 11:15 AM, Pascal SANCHO <pa...@takoma.fr>wrote:

> Mahesh Rayudu a écrit :
>
>> Hi Pascal,
>>
>>   I tried this option. but the vertical line is breaking and its not
>> coming continuosly if blocks has span="none". I am using latest trunk build
>> FOP jar to generate PDF file.
>>  XSL-FO config:
>>  <fo:simple-page-master master-name="only"
>>                  page-height="11in"
>>                  page-width="8.5in"
>>                  margin-top="1in"
>>                  margin-bottom="1in"
>>                  margin-left="0.75in"
>>                  margin-right="0.75in">
>>      <fo:region-body
>>          margin-top="0.25in" margin-bottom="1in"
>>          column-count="2" column-gap="0.15in"
>>   background-position-horizontal="center"
>>                  background-repeat="repeat-y"
>>                  background-image='url("line1.svg")'/>
>>      <fo:region-before extent="1in"/>
>>      <fo:region-after extent="1in"/>
>>    </fo:simple-page-master>
>>   Line svg file code:
>>  <?xml version="1.0" standalone="no"?>
>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>> "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
>> <svg width="100%" height="100%" version="1.1"
>> xmlns="http://www.w3.org/2000/svg">
>> <line x1="0" y1="0" x2="0" y2="100"
>> style="stroke:rgb(99,99,99);stroke-width:2"/>
>> </svg>
>>  Any help on this would be great helpful.
>>  Thanks
>> Mahesh
>>
> This works fine (except the vertical line witch is not centered in the svg
> drawing).
> Note that background-color must be applied only on spanned blocks that are
> direct children of fo:flow.
>
> Try this with your fo:simple-page-master:
> <fo:page-sequence master-reference="only">
>   <fo:flow flow-name="xsl-region-body">
>     <fo:block>some text. some text. some text. some text. some
> text.</fo:block>
>     <fo:block>some text. some text. some text. some text. some
> text.</fo:block>
>     <fo:block span="all" background-color="white">spanning some text.
> spanning some text. spanning some text. spanning some text.</fo:block>
>      <fo:block>some text. some text. some text. some text. some
> text.</fo:block>
>   </fo:flow>
>  </fo:page-sequence>
>
>
> Pascal
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>

Re: How to draw vertical line between columns in region body

Posted by Pascal SANCHO <pa...@takoma.fr>.
Mahesh Rayudu a écrit :
> Hi Pascal,
>  
>  
> I tried this option. but the vertical line is breaking and its not 
> coming continuosly if blocks has span="none". 
> I am using latest trunk build FOP jar to generate PDF file.
>  
> XSL-FO config:
>  
> <fo:simple-page-master master-name="only"
>                   page-height="11in"
>                   page-width="8.5in"
>                   margin-top="1in"
>                   margin-bottom="1in"
>                   margin-left="0.75in"
>                   margin-right="0.75in">
>       <fo:region-body
>           margin-top="0.25in" margin-bottom="1in"
>           column-count="2" column-gap="0.15in"
>    background-position-horizontal="center"
>                   background-repeat="repeat-y"
>                   background-image='url("line1.svg")'/>
>       <fo:region-before extent="1in"/>
>       <fo:region-after extent="1in"/>
>     </fo:simple-page-master>
>  
>  
> Line svg file code:
>  
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
> "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
> <svg width="100%" height="100%" version="1.1"
> xmlns="http://www.w3.org/2000/svg">
> <line x1="0" y1="0" x2="0" y2="100"
> style="stroke:rgb(99,99,99);stroke-width:2"/>
> </svg>
>  
> Any help on this would be great helpful.
>  
> Thanks
> Mahesh
This works fine (except the vertical line witch is not centered in the 
svg drawing).
Note that background-color must be applied only on spanned blocks that 
are direct children of fo:flow.

Try this with your fo:simple-page-master:
<fo:page-sequence master-reference="only">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>some text. some text. some text. some text. some 
text.</fo:block>
      <fo:block>some text. some text. some text. some text. some 
text.</fo:block>
      <fo:block span="all" background-color="white">spanning some text. 
spanning some text. spanning some text. spanning some text.</fo:block>
       <fo:block>some text. some text. some text. some text. some 
text.</fo:block>
    </fo:flow>
  </fo:page-sequence>

Pascal


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: How to draw vertical line between columns in region body

Posted by Mahesh Rayudu <ma...@gmail.com>.
Hi Pascal,


I tried this option. but the vertical line is breaking and its not coming
continuosly if blocks has span="none".
I am using latest trunk build FOP jar to generate PDF file.

XSL-FO config:

<fo:simple-page-master master-name="only"
                  page-height="11in"
                  page-width="8.5in"
                  margin-top="1in"
                  margin-bottom="1in"
                  margin-left="0.75in"
                  margin-right="0.75in">
      <fo:region-body
          margin-top="0.25in" margin-bottom="1in"
          column-count="2" column-gap="0.15in"
   background-position-horizontal="center"
                  background-repeat="repeat-y"
                  background-image='url("line1.svg")'/>
      <fo:region-before extent="1in"/>
      <fo:region-after extent="1in"/>
    </fo:simple-page-master>


Line svg file code:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<line x1="0" y1="0" x2="0" y2="100"
style="stroke:rgb(99,99,99);stroke-width:2"/>
</svg>

Any help on this would be great helpful.

Thanks
Mahesh

On Fri, Jun 5, 2009 at 3:20 AM, Pascal SANCHO <pa...@takoma.fr>wrote:

> Hi,
>
> Mahesh Rayudu a écrit :
>
>> Hi Pietschmann,
>>  As per your suggestion, I tried to insert background svg image for blocks
>> which do not have span="all" property. But the vertical line is coming twice
>> because we dont know what is the end block for first column in region body.
>> I want to draw vertical line between columns only.
>>  Any help would be greatly appreciate.
>>  Thanks
>> Mahesh Rayudu.
>>
>> On Thu, Jun 4, 2009 at 4:49 PM, Mahesh Rayudu <mahesh.rayudu@gmail.com<mailto:
>> mahesh.rayudu@gmail.com>> wrote:
>>
>>    Hi Pietschmann,
>>        Thanks for reply.     I an newbie to SVG. if any sample files would
>> be appreciate.
>>            Thanks
>>    Mahesh
>>
>>    On Thu, Jun 4, 2009 at 4:21 PM, J.Pietschmann <j3322ptm@yahoo.de
>>    <ma...@yahoo.de>> wrote:
>>
>>        On 04.06.2009 21:26, MaheshR wrote:
>>
>>            My problem is that if I have span="none", I want to draw
>>            vertical line
>>            between columns.
>>
>>
>>        The commonly suggested solution is to use a background image
>>        for the body region. You can try to use an SVG instead of
>>        a bitmap image. If you have a span="all" block, you should
>>        give it a white backgound image in order to mask the vertical
>>        line for this block.
>>
>>        J.Pietschmann
>>
>> What JP suggested was:
> put a background onto the body region, not directly on to fo:block.
> This is why objects with span="all" should be "backgrounded" with white,
> masking the vertical line.
>
> In fact you have several options to achieve this:
> 1/ define a background-image for the fo:region-body:
> <fo:simple-page-master master-name="xxx">
>  <fo:region-body  background-image="image_url"/>
>  <!-- the image can be in any format, but svg gives nice result -->
> </fo:simple-page-master>
> 2/ insert a fo:block-container absolutely positionned in one of the static
> regions (better choice is start-region, since its coordinate origin is the
> same as the page)
>  note that this only works with FOP 0.9x.
>  in this latter case, an empty fo:b-c (with an empty fo:block) is
> sufficient, you just need a vertical border on it.
>
> HTH,
>
> Pascal
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>

Re: How to draw vertical line between columns in region body

Posted by Pascal SANCHO <pa...@takoma.fr>.
Hi,

Mahesh Rayudu a écrit :
> Hi Pietschmann,
>  
> As per your suggestion, I tried to insert background svg image for 
> blocks which do not have span="all" property. But the vertical line is 
> coming twice because we dont know what is the end block for first 
> column in region body. I want to draw vertical line between columns only.
>  
> Any help would be greatly appreciate.
>  
> Thanks
> Mahesh Rayudu.
>
> On Thu, Jun 4, 2009 at 4:49 PM, Mahesh Rayudu <mahesh.rayudu@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Hi Pietschmann,
>      
>     Thanks for reply. 
>      I an newbie to SVG. if any sample files would be appreciate.
>      
>      
>     Thanks
>     Mahesh
>
>     On Thu, Jun 4, 2009 at 4:21 PM, J.Pietschmann <j3322ptm@yahoo.de
>     <ma...@yahoo.de>> wrote:
>
>         On 04.06.2009 21:26, MaheshR wrote:
>
>             My problem is that if I have span="none", I want to draw
>             vertical line
>             between columns.
>
>
>         The commonly suggested solution is to use a background image
>         for the body region. You can try to use an SVG instead of
>         a bitmap image. If you have a span="all" block, you should
>         give it a white backgound image in order to mask the vertical
>         line for this block.
>
>         J.Pietschmann
>
What JP suggested was:
put a background onto the body region, not directly on to fo:block.
This is why objects with span="all" should be "backgrounded" with white, 
masking the vertical line.

In fact you have several options to achieve this:
 1/ define a background-image for the fo:region-body:
<fo:simple-page-master master-name="xxx">
   <fo:region-body  background-image="image_url"/>
   <!-- the image can be in any format, but svg gives nice result -->
</fo:simple-page-master>
2/ insert a fo:block-container absolutely positionned in one of the 
static regions (better choice is start-region, since its coordinate 
origin is the same as the page)
   note that this only works with FOP 0.9x.
   in this latter case, an empty fo:b-c (with an empty fo:block) is 
sufficient, you just need a vertical border on it.

HTH,

Pascal

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: How to draw vertical line between columns in region body

Posted by Mahesh Rayudu <ma...@gmail.com>.
Hi Pietschmann,

As per your suggestion, I tried to insert background svg image for blocks
which do not have span="all" property. But the vertical line is coming twice
because we dont know what is the end block for first column in region body.
I want to draw vertical line between columns only.

Any help would be greatly appreciate.

Thanks
Mahesh Rayudu.

On Thu, Jun 4, 2009 at 4:49 PM, Mahesh Rayudu <ma...@gmail.com>wrote:

> Hi Pietschmann,
>
> Thanks for reply.
>  I an newbie to SVG. if any sample files would be appreciate.
>
>
> Thanks
> Mahesh
>
>   On Thu, Jun 4, 2009 at 4:21 PM, J.Pietschmann <j3...@yahoo.de> wrote:
>
>> On 04.06.2009 21:26, MaheshR wrote:
>>
>>> My problem is that if I have span="none", I want to draw vertical line
>>> between columns.
>>>
>>
>> The commonly suggested solution is to use a background image
>> for the body region. You can try to use an SVG instead of
>> a bitmap image. If you have a span="all" block, you should
>> give it a white backgound image in order to mask the vertical
>> line for this block.
>>
>> J.Pietschmann
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>
>>
>

Re: How to draw vertical line between columns in region body

Posted by Mahesh Rayudu <ma...@gmail.com>.
Hi Pietschmann,

Thanks for reply.
 I an newbie to SVG. if any sample files would be appreciate.


Thanks
Mahesh

On Thu, Jun 4, 2009 at 4:21 PM, J.Pietschmann <j3...@yahoo.de> wrote:

> On 04.06.2009 21:26, MaheshR wrote:
>
>> My problem is that if I have span="none", I want to draw vertical line
>> between columns.
>>
>
> The commonly suggested solution is to use a background image
> for the body region. You can try to use an SVG instead of
> a bitmap image. If you have a span="all" block, you should
> give it a white backgound image in order to mask the vertical
> line for this block.
>
> J.Pietschmann
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>

Re: How to draw vertical line between columns in region body

Posted by "J.Pietschmann" <j3...@yahoo.de>.
On 04.06.2009 21:26, MaheshR wrote:
> My problem is that if I have span="none", I want to draw vertical line
> between columns.

The commonly suggested solution is to use a background image
for the body region. You can try to use an SVG instead of
a bitmap image. If you have a span="all" block, you should
give it a white backgound image in order to mask the vertical
line for this block.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org