Hi,

Le 08/11/2011 20:35, gkasper a écrit :
> 
> Pascal Sancho wrote:
>>
>> Hi,
>>
>> You should apply them on fo:external-graphic: i-p-d and b-p-d replacing
>> respectively width and height.
>> fo:block b-p-d depends on its content if defaulting to 'auto'.
>>
>> content-* should have 'scale-to-fit' or equivalent value.
>>
>> You can leave fo:external-graphic/@i-p-d as '100%', that's ok.
>>
> Hi Pascal,
> 
> Thank you, still doesn't work...
> As suggested before, here is a smallest sample XML:
> 
> <?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 page-height="279.4mm" page-width="215.9mm"
> margin-top="0mm" margin-bottom="0mm" margin-left="0mm" margin-right="0mm"
> master-name="PageMaster">
>   <fo:region-body border-style="none" border-width="thin" margin-top="10mm"
> margin-left="0mm" margin-right="0mm" margin-bottom="0mm" /> 
>   </fo:simple-page-master>
>   </fo:layout-master-set>
> <fo:page-sequence initial-page-number="1" master-reference="PageMaster">
> <fo:flow flow-name="xsl-region-body">
> <fo:block>
> <fo:block top="10mm" left="0mm" width="215.9mm" height="269.4mm"

top and left are relative properties when used with fo:block.
They should be used with relative-position property, but they are not
implemented by FOP (see [1])

width and height have no effect on this fo:block:
corresponding traits are affected by inheritance, content and other
propreties like *-indent, padding-*, space-*, etc.

> margin-top="0mm" margin-left="0mm" margin-right="0mm" margin-bottom="0mm">
>   <fo:external-graphic src="url(Images/MASTER_CMS-1500-v4.gif)"
> content-height="269.4mm" content-width="215.9mm" scaling="uniform"

content-* should have 'scale-to-fit' (or scale-down-to-fit), that is a
good practice

> block-progression-dimension.maximum="269.4mm"
> block-progression-dimension.optimum="269.4mm"

if you want to have "elasctic" size, you should set different values to
.optimum and .maximum:
usualy, if the image height is smaller than the available height
(specified with b-p-d.maximum), then the reserved space height is a
value between these 2 properties.

That avoids to get a blank rectange before or after the image.

> inline-progression-dimension="100%" /> 
>   </fo:block>
> <fo:block-container absolute-position="absolute"
> top="4.753550465282748746mm" left="102.14mm" content-width="scale-to-fit"
> content-height="scale-to-fit" scaling="uniform" width="100%" height="100%"
> margin-top="0mm" margin-left="0mm" margin-right="0mm" margin-bottom="0mm"
> font-size="10pt">
>   <fo:block font-weight="bold"
> space-after="0em">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</fo:block> 
>   </fo:block-container>
>   </fo:block>
>   </fo:flow>
>   </fo:page-sequence>
>   </fo:root> http://old.nabble.com/file/p32805321/MASTER.gif MASTER.gif 
> I attached a sample gif file also. I would really appreciate if you could
> help me here.

In addition, due to half leadind, there is extra space before and after
the image, depending on font-size and line-height.

It's a good practice to set both font-size and line-height to 0 on the
surrending fo:block when there is no descendant text node within it.

Note that line-height defaults to 1.2 (witch means 1.2 * line-height),
so in this case you need to explicitely set only font-height to 0.

Your snippet should be like that:
<fo:block font-size="0">
  <fo:external-graphic src="url(Images/MASTER_CMS-1500-v4.gif)"
      block-progression-dimension.maximum="269.4mm"
      block-progression-dimension.optimum="100mm"
      inline-progression-dimension="100%"
      content-height="scale-to fit" content-width="scale-to fit"
      scaling="uniform"/>
</fo:block>

[1]
http://xmlgraphics.apache.org/fop/compliance.html#fo-property-commonrelpos-section
-- 
Pascal

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to