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 Olivier <ti...@yahoo.fr> on 2006/02/28 19:30:44 UTC

Center block with border

Hi,

i would like to center and border blocks (some blocks may contain linefeed or
may extend page/block width --> multi-lines) like this :

---------------------------
|                         |
|                         |
|        ---------        |
|        |  bla  |        |
|        ---------        |
|                         |
|                         |
|      -------------      |
|      |    bla    |      |
|      |  bla bla  |      |
|      -------------      |
|                         |
|                         |
---------------------------

If i use :
<fo:block border-style="solid" padding="0.5cm">bla bla</fo:block>
<fo:block white-space-collapse="false" white-space-treatment="preserve"
text-align="center" border-style="solid" padding="0.5cm">bla bla
bla bla bla</fo:block>
the border take all page's width :

---------------------------
|                         |
|                         |
|-------------------------|
||          bla          ||
|-------------------------|
|                         |
|                         |
|                         |
|-------------------------|
||          bla          ||
||        bla bla        ||
|-------------------------|
|                         |
|                         |
---------------------------


If i use :
<fo:block><fo:inline border-style="solid" padding="0.5cm">bla
bla</fo:inline></fo:block>
<fo:block white-space-collapse="false" white-space-treatment="preserve"
text-align="center" border-style="solid" padding="0.5cm"><fo:inline
border-style="solid" padding="0.5cm">bla bla
bla bla bla</fo:inline></fo:block>
the 1st block is ok, but the 2nd... :

---------------------------
|                         |
|                         |
|        ---------        |
|        |  bla  |        |
|        ---------        |
|                         |
|                         |
|        ---------        |
|        |  bla           |
|      -------------      |
|        ---------        |
|         bla bla  |      |
|      -------------      |
|                         |
|                         |
---------------------------

any idea ?

Ps : blocks are in a table (all page width), each in a row/cell (span)
Fop 0.91 beta


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


Re: Center block with border

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Bad news: The layout manager for fo:inline-container is an empty shell.
It just doesn't work, yet. http://xmlgraphics.apache.org/fop/compliance.html#fo-object-inline-container

On 28.02.2006 22:01:14 J.Pietschmann wrote:
> Olivier wrote:
> > i would like to center and border blocks (some blocks may contain linefeed or
> > may extend page/block width --> multi-lines) like this :
> ...
> > the 1st block is ok, but the 2nd... :
> ...
> > any idea ?
> 
> The second is a though one. You could try an inline-container:
>   <fo:block white-space-collapse="false" white-space-treatment="preserve"
>   text-align="center" border-style="solid"
>    padding="0.5cm"><fo:inline-container><fo:block border-style="solid"
>    padding="0.5cm">bla bla
>   bla bla bla<fo:block></fo:inline-container></fo:block>
> I'm not sure whether FOP 0.91 already implements enough of
> inline-container to make this work.
> In any case, I somehow doubt there is a pure FO solution without
> automatic table layout. I'd concentrate on trying to estimate the
> line widths and go for the classic blind table centering solution.
> Asking on the Yahoo FO list or the XSL list, where Ken Holman and
> Eliot Kimber tend to hang out, might get you a more satisfactory answer.



Jeremias Maerki


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


Re: Center block with border

Posted by Olivier <ti...@yahoo.fr>.
J.Pietschmann <j3322ptm <at> yahoo.de> writes:

> I'm not sure whether FOP 0.91 already implements enough of
> inline-container to make this work.
> In any case, I somehow doubt there is a pure FO solution without
> automatic table layout. I'd concentrate on trying to estimate the
> line widths and go for the classic blind table centering solution.
> Asking on the Yahoo FO list or the XSL list, where Ken Holman and
> Eliot Kimber tend to hang out, might get you a more satisfactory answer.
> 
> J.Pietschmann
> 

Thank's.
With <fo:inline-container> there is no print, just white space.
Automatic table layout is not supported by FOP, and i have no idea how estimate
line width, so...



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


Re: Center block with border

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Olivier wrote:
> i would like to center and border blocks (some blocks may contain linefeed or
> may extend page/block width --> multi-lines) like this :
...
> the 1st block is ok, but the 2nd... :
...
> any idea ?

The second is a though one. You could try an inline-container:
  <fo:block white-space-collapse="false" white-space-treatment="preserve"
  text-align="center" border-style="solid"
   padding="0.5cm"><fo:inline-container><fo:block border-style="solid"
   padding="0.5cm">bla bla
  bla bla bla<fo:block></fo:inline-container></fo:block>
I'm not sure whether FOP 0.91 already implements enough of
inline-container to make this work.
In any case, I somehow doubt there is a pure FO solution without
automatic table layout. I'd concentrate on trying to estimate the
line widths and go for the classic blind table centering solution.
Asking on the Yahoo FO list or the XSL list, where Ken Holman and
Eliot Kimber tend to hang out, might get you a more satisfactory answer.

J.Pietschmann


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