Re: margin herit

Hi Marc

Yes, it's a well-known topic. Strictly speaking, FOP behaves according
to the spec and XEP does not. That has been verified with the XSL
working group. The problem is that the effects may not match user
expectations which is why many FO implementations have chosen to reset
indents over the so-called reference area boundary rather than to adhere
to the specification.

If you want to learn about the details, I wrote a report on the topic
here: http://wiki.apache.org/xmlgraphics-fop/IndentInheritance

Long story short: you can tell FOP to "misbehave" and also reset the
indents. Check out [1] and look for "break-indent-inheritance". Or if
you configure FOP from Java code, look at [2] and look for
"setBreakIndentInheritanceOnReferenceAreaBoundary".

[1] http://xmlgraphics.apache.org/fop/1.0/configuration.html
[2] http://xmlgraphics.apache.org/fop/1.0/embedding.html#fop-factory

HTH
Jeremias Maerki


On 08.06.2012 13:51:42 Marc wrote:
> Hallo,
> I have a problem with FOP with the FO file join below.
> The problem is from the margin heritage.
> The margin is inherited else if I indicate new value.
> Here is the sample, I test it with XEP it's ok, but not with FOP.
> Do anyone knows this problem? I don't read anything about that!
> 
> Marc
> --------------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>     <fo:layout-master-set>
>         <fo:simple-page-master master-name="page" page-height="29.7cm" 
> page-width="21cm" margin-left="2cm">
>             <fo:region-body/>
>         </fo:simple-page-master>
>     </fo:layout-master-set>
>     <fo:page-sequence master-reference="page">
>         <fo:flow flow-name="xsl-region-body">
>             <fo:block background-color="blue">
>                 <fo:block-container reference-orientation="0" 
> background-color="red" margin-left="1cm">
>                     <fo:block background-color="yellow" 
> margin-left="0cm">should be ok</fo:block>
>                 </fo:block-container>
>             </fo:block>
>             <fo:block background-color="blue">
>                 <fo:block-container reference-orientation="0" 
> background-color="red" margin-left="1cm">
>                     <fo:block background-color="yellow" 
> margin-left="-1cm">is ok with a -1cm as margin-left</fo:block>
>                 </fo:block-container>
>             </fo:block>
>             <fo:block background-color="blue">
>                 <fo:block background-color="yellow" margin-left="1cm">
>                     <fo:table>
>                         <fo:table-body>
>                             <fo:table-row>
>                                 <fo:table-cell background-color="green">
>                                     <fo:block background-color="red" 
> margin-left="0cm">should be ok</fo:block>
>                                 </fo:table-cell>
>                             </fo:table-row>
>                         </fo:table-body>
>                     </fo:table>
>                 </fo:block>
>             </fo:block>
>             <fo:block background-color="blue">
>                 <fo:block background-color="yellow" margin-left="1cm">
>                     <fo:table>
>                         <fo:table-body>
>                             <fo:table-row>
>                                 <fo:table-cell background-color="green" 
> margin-left="0cm">
>                                     <fo:block background-color="red">is 
> ok with a margin-left at 0cm on the table-cell</fo:block>
>                                 </fo:table-cell>
>                             </fo:table-row>
>                         </fo:table-body>
>                     </fo:table>
>                 </fo:block>
>             </fo:block>
>         </fo:flow>
>     </fo:page-sequence>
> </fo:root>

Received on Friday, 8 June 2012 13:12:37 UTC