xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Sancho <pascal.san...@takoma.fr>
Subject Re: Background image
Date Mon, 07 Nov 2011 08:54:16 GMT
Hi,

In XSL-FO, in default context, height specifies the
block-progression-dimension

reading the XSL-FO spec (see §7.15.3 at [1]):
b-p-d expressed in % "is calculated with respect to the corresponding
dimension of the closest area ancestor that was generated by a
block-level formatting object", here the outer fo:block
and:
"If that dimension is not specified explicitly (i.e., it depends on
content's block-progression-dimension), the value is interpreted as
"auto".", witch is the case here.
So, the fo-block b-p-d depends on its content.

IOW: you have no contraints vertically, so if your image is heigher than
available body content-height, FOP try to render it on next page.

You should set an absolute height (not relative) to your
fo:external-graphic.

[1] http://www.w3.org/TR/xsl/#block-progression-dimension

Le 07/11/2011 01:42, gkasper a écrit :
> 
> Hi All,
> I'm new to FOP, having a project that uses FOP.
> I have two problems, I think both related to the background image, not sure
> though.
> I have a big form, the data comes from the database, and I need to fill it
> in to the appropriate positions on the background image. I create it this
> way:
> 
> <?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="0mm"
> 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:external-graphic src="url(Images/MASTER.gif)"
> content-height="scale-to-fit" scaling="uniform" height="100%" width="100%"
> /> 
>   </fo:block>
> ..................
> etc
> 
> This way it works fine, but as soon as I make margin-top=10mm:
> 
> <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" /> 
> 
> FOP creates automatically an extra page, and all data go to the second page,
> background image remains empty on the first page.  What am I doing wrong? (I
> noticed that up until 7mm it works just fine, but if I change margin to 8mm
> or bigger - I get this issue). This is problem #1.
> 
> Second problem is: if I make margin-top="10mm", in addition to what I said
> before, somehow I'm missing part of the background image, bottom part of it,
> it just gets cut off. From what I understand, it shouldn't happen, as I
> mentioned: content-height="scale-to-fit" scaling="uniform" height="100%"
> width="100%" for the image...  What is wrong here?
> I'm kind of stuck, tried different things: scaling="non-uniform",
> height="auto", I even tried giving the concrete height and width in mm -
> nothing works. Also, googling didn't help much.
> 
> I would appreciate your help, All !
> Thanks,
> George

-- 
Pascal

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


Mime
View raw message