[xep-support] Floating images

Elizabeth.Luna at fdi.de Elizabeth.Luna at fdi.de
Tue Jul 26 01:09:43 PDT 2011


Hello,

I need your help please.

I have problems to display images that are inside a text.

I try to float the images within the text to the left or right side and I
always get a top margin has not been assigned

I guess that is the "<fo:block>" inside the "<fo:float.>" or maybe I
have another error ....

how this image could be displayed in a line above?

how could I get a top alignment ?

The XML code is:
<normal-text>
	Nam liber tempor cum soluta nobis eleifend option congue nihil
imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum
dolor sit amet,
	consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt
ut laoreet dolore magna aliquam erat
	<img src="files/img/web/testbilder von fdi/353.jpg" width="95px"
height="133px" align="right" alt="" title="" caption="" padding-top="0px"
padding-left="0px" 		padding-bottom="0px" padding-right="0px"
margin-top="0px" margin-left="0px" margin-bottom="0px" margin-right="0px">

    	</img>
  	Volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo
consequat. Consetetur sadipscing 	elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea 	rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 	nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita 	kasd gubergren, ........
      <line-break>
      </line-break>
</normal-text>
<normal-text clear="true">
	Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy
	<img src="files/img/web/testbilder von fdi/353.jpg" width="95px"
height="133px" align="right" alt="" title="" caption="" padding-top="0px"
padding-left="5px" 	padding-bottom="5px" padding-right="5px" margin-top
="0px" margin-left="5px" margin-bottom="5px" margin-right="5px">
	 <line-break>
	</line-break>
	</img>
	<line-break>
	</line-break>
</normal-text>



And the code for the transformation of the images is the following:

	<xsl:template match="normal-text">
		<fo:block xsl:use-attribute-sets="normal-text hyphenate"
			text-align="justify" margin-bottom="12pt">
			<xsl:call-template name="clear-handler"/>

			<xsl:apply-templates select="text()|node()"/>
		</fo:block>
	</xsl:template>


	<xsl:template match="img">
		<fo:float float="{@align}">

			<fo:block>
				<fo:external-graphic src="url(../../{@src})"
content-width="{@width}" content-height="{@height}">
					<xsl:call-template name="margins"/>
					<xsl:call-template name="paddings"/>

				</fo:external-graphic>
			</fo:block>
		</fo:float>
	</xsl:template>

	<xsl:template name="margins">
		<xsl:if test="@margin-top!=''">
			<xsl:attribute name="margin-top"><xsl:value-of select="
@margin-top"/></xsl:attribute>
		</xsl:if>
		<xsl:if test="@margin-left!=''">
			<xsl:attribute name="margin-left"><xsl:value-of select="
@margin-left"/></xsl:attribute>
		</xsl:if>
		<xsl:if test="@margin-bottom!=''">
			<xsl:attribute name="margin-bottom"><xsl:value-of select
="@margin-bottom"/></xsl:attribute>
		</xsl:if>
		<xsl:if test="@margin-right!=''">
			<xsl:attribute name="margin-right"><xsl:value-of select="
@margin-right"/></xsl:attribute>
		</xsl:if>
		<xsl:if test="@margin!=''">
			<xsl:attribute name="margin"><xsl:value-of select="
@margin"/></xsl:attribute>
		</xsl:if>
	</xsl:template>

	<xsl:template name="paddings">
		<xsl:if test="@padding-top!=''">
			<xsl:attribute name="padding-top"><xsl:value-of select="
@padding-top"/></xsl:attribute>
		</xsl:if>
		<xsl:if test="@padding-left!=''">
			<xsl:attribute name="padding-left"><xsl:value-of select="
@padding-left"/></xsl:attribute>
		</xsl:if>
		<xsl:if test="@padding-bottom!=''">
			<xsl:attribute name="padding-bottom"><xsl:value-of select
="@padding-bottom"/></xsl:attribute>
		</xsl:if>
		<xsl:if test="@padding-right!=''">
			<xsl:attribute name="padding-right"><xsl:value-of select
="@padding-right"/></xsl:attribute>
		</xsl:if>
		<xsl:if test="@padding!=''">
			<xsl:attribute name="padding"><xsl:value-of select="
@padding"/></xsl:attribute>
		</xsl:if>
	</xsl:template>



An example of the resulting pdf file:




(See attached file: Test_img.pdf)


Thank you


Regards,

Elizabeth Luna
Entwicklung




fabrique d´images ebusiness GmbH
Ankergässele 2  -  87435 Kempten (Allgäu)  -  Germany
Phone +49 (0)831 / 52 39 40 0  -  Fax +49 (0)831 / 52 39 40 79
 eMail Elizabeth.Luna at fdi.de
www.fdi.de

Geschäftsführer: Thomas Reisacher
Sitz der Gesellschaft: Kempten (Allgäu)
Registergericht: Kempten HRB 1749
Ust.-ID-Nummer: DE 216 196 532

__________________________________________________________________________________________________________________________________
  Please consider the environment before printing this e-mail.

!DSPAM:87,4e2e796f63731284112426!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20110726/a52746c4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0E633478.gif
Type: image/gif
Size: 85670 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20110726/a52746c4/attachment-0003.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0E808332.gif
Type: image/gif
Size: 2736 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20110726/a52746c4/attachment-0004.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0E025906.gif
Type: image/gif
Size: 94 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20110726/a52746c4/attachment-0005.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test_img.pdf
Type: application/pdf
Size: 41337 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20110726/a52746c4/attachment-0001.pdf>


More information about the Xep-support mailing list