IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

XML/XSL et SOAP Discussion :

FOP: Superposer deux <fo:external-graphic>


Sujet :

XML/XSL et SOAP

  1. #1
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Décembre 2004
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2004
    Messages : 4
    Points : 1
    Points
    1
    Par défaut FOP: Superposer deux <fo:external-graphic>
    Bonjour a tous,

    alors voila, je m'arrache les cheuveux depuis plusieurs jour pour trouver un moyen de superposer deux images en FO. L'image en premier plan étant évidemment plus petite que celle de l'arrière plan.

    Voici la partie de mon XSL qui contient l'image d'arrière plan :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    <fo:table>
    	<fo:table-column column-width="40cm"/>
    		<fo:table-body border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" > 
    			<fo:table-row>
    				<fo:table-cell border-right-style="solid" border-top-style="solid" border-bottom-style="solid">
    					<fo:block id="N2531">
    	  				<fo:block>
    						<fo:external-graphic src="file:{CARTE[@name='map']/RESULTAT/ARCXML/RESPONSE/IMAGE/OUTPUT/@file}" height="21cm" width="40cm" mapblock="map" />
    					</fo:block>
    					</fo:block>
    				</fo:table-cell>
    			</fo:table-row>
    		</fo:table-body>
    	</fo:table>
    Ce que je veux, c'est ajouter une petite image (2cm sur 4cm) dans le coin haut droit de <fo:external-graphic src="file:{CARTE[@name='map']/RESULTAT/ARCXML/RESPONSE/IMAGE/OUTPUT/@file}" height="21cm" width="40cm" mapblock="map" />


    Help ... Je désespère. Merci de me dire si ce que je cherche est possible ou non.

  2. #2
    Membre expérimenté
    Avatar de virgul
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    1 625
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2004
    Messages : 1 625
    Points : 1 666
    Points
    1 666
    Par défaut
    Salut,

    Quel est ton processeur Fo? Altsoft, XEP, FOP, TEX

    Tous ont des caractéristiques différentes!


    ++

    Thierry
    "Life is short don't forget to inhale"
    Mais: "Mieux vaux arriver en retard dans ce monde... qu'en avance à l'autre."

  3. #3
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Décembre 2004
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2004
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    Mon appli fonctionne avec FOP. Je ne savais pas qu'il en existait d'autres.

  4. #4
    Membre expérimenté
    Avatar de virgul
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    1 625
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2004
    Messages : 1 625
    Points : 1 666
    Points
    1 666
    Par défaut
    Mon appli fonctionne avec FOP. Je ne savais pas qu'il en existait d'autres.
    Oui mais il sont payants FOP est le seul Freeware mais c'est le plus limité dans les fonctions implémentés!

    Car Sache qu'aucun processeur FO ne supporte totalement la norme XSL-FO d'ou le faite que certaine fois ca ne marche pas car ce n'est pas implémenté!

    Perso j'ai aussi utiliser FOP car si tu ne fait pas quelquechose de très compliqué ou de très design(image) FOP suffit largement!

    Pour ton problème :

    Qu'es-ce que te renvoie ton src quand tuu as ton fichier FO?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <fo:external-graphic src="file:{CARTE[@name='map']/RESULTAT/ARCXML/RESPONSE/IMAGE/OUTPUT/@file}" height="21cm" width="40cm" mapblock="map" />
    Chez moi je renvoit ca et ca marche:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <fo:external-graphic src="logo/hrazh.jpg"/>
    il s'agit d'un image de background si c'est le cas il y a un attribut pour ca dans les proprieté de la page pour éviter de superposer!

    Pourquoi 40cm de width ca fait plus d'une page?
    "Life is short don't forget to inhale"
    Mais: "Mieux vaux arriver en retard dans ce monde... qu'en avance à l'autre."

  5. #5
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Décembre 2004
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2004
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    C'est vrai que ca manque un peu d'explication :

    Mon appli est un Système d'Information Géographique. Je manipule donc des cartes constituées de couches (shape Arcview si ca te dit quelque chose) et des attributs de ces couches contenus dans des dbf.

    ca :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <fo:external-graphic src="file:{CARTE[@name='map']/RESULTAT/ARCXML/RESPONSE/IMAGE/OUTPUT/@file}" height="21cm" width="40cm" mapblock="map" />
    c'est une carte (un png) renvoyer par ArcIms qui est un logiciel de cartographie pour le web.

    Pourquoi 40cm de width ca fait plus d'une page?
    C'est une page A3 Paysage.

    Voili voilou ...


    Ce que je cherche a faire, c'est de superposer une petite carte (de 4 sur 4 par ex.) de situation global a la carte principale.

  6. #6
    Membre expérimenté
    Avatar de virgul
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    1 625
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2004
    Messages : 1 625
    Points : 1 666
    Points
    1 666
    Par défaut
    Ok je comprend maintenant!

    Alors pourquoi ne pas mettre la grande image en background et après tu peux sans problème placer tes petites image sur ta page?

    Et comme ca tu évite de devoir superposé deux images chose qui ne doit pas être aisé connaissant FOP!

    Pour ce faire:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <fo:layout-master-set>
    			<fo:simple-page-master master-name="first" page-height="29.7cm" page-width="21cm" margin-top="1mm" margin-bottom="3mm" margin-left="3mm" margin-right="3mm">
    				<xsl:choose>
    					<xsl:when test="@inBearb!=0">
    						<fo:region-body margin-top="3.6cm" margin-bottom="1.5cm" background-image="inBearb.jpg"/>
    					</xsl:when>
    					<xsl:otherwise>
    						<fo:region-body margin-top="3.6cm" margin-bottom="1.5cm"/>
    					</xsl:otherwise>
    				</xsl:choose>
    				<fo:region-before region-name="title1" extent="3.7cm"/>
    				<fo:region-after extent="1cm"/>
    			</fo:simple-page-master>

    tu peux voir comme ca ou tu doit déclaré ton background-image="inBearb.jpg"

    a part ca pour les png je crois qu'y a une limitation et tu doit installer un autre package:

    voir ici: http://xml.apache.org/fop/graphics.html#png

    If using JAI for PNG support, only RGB and RGBA color-spaces are supported for FOP rendering.

    pour installer JAI: http://xml.apache.org/fop/graphics.html#jai

    avoir avec JIMI y a pas c'est limitation essaye plutot celui-ci en premier
    http://xml.apache.org/fop/graphics.html#jimi


    ++

    Thierry
    "Life is short don't forget to inhale"
    Mais: "Mieux vaux arriver en retard dans ce monde... qu'en avance à l'autre."

  7. #7
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Décembre 2004
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2004
    Messages : 4
    Points : 1
    Points
    1
    Par défaut
    a part ca pour les png je crois qu'y a une limitation et tu doit installer un autre package:

    voir ici: http://xml.apache.org/fop/graphics.html#png
    De ce coté la, ca roule ...
    Je précise que je ne suis pas le développeur de cette appli. Elle nous a été fourni par Esri France et je tatonne un peu pour essayer d'ajouter quelque petites chose, mais elle est complètement fonctionnelle.


    Pour en revenir a mon XSL, je vais te coller tous mon code en éspérant ne pas me faire incendier par les modérateurs

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
     
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xsl:stylesheet
    	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    	xmlns:fo="http://www.w3.org/1999/XSL/Format"
    	version="1.0">
     
    <xsl:template match="MISEENPAGE">
     
    <fo:root font-family="Helvetica" font-size="12pt" text-align="center" xmlns:fo="http://www.w3.org/1999/XSL/Format">
     
    <fo:layout-master-set>
    	<fo:simple-page-master master-name="A4P"
    	margin-top="1cm" margin-bottom="1cm" margin-left="1cm" 
    	margin-right="1cm" page-height="29.7cm" 
                      page-width="21cm" >
     
    	<fo:region-body />
    	</fo:simple-page-master>
     
    	<fo:simple-page-master master-name="A4L"
    	margin-top="1cm" margin-bottom="1cm" margin-left="1cm" 
    	margin-right="1cm" page-height="21cm" 
                      page-width="29.7cm" >
     
    	<fo:region-body />
    	</fo:simple-page-master>
     
    	<fo:simple-page-master master-name="A3P"
    	margin-top="1cm" margin-bottom="1cm" margin-left="1cm" 
    	margin-right="1cm" page-height="42cm" 
                      page-width="29.7cm" >
     
    	<fo:region-body />
    	</fo:simple-page-master>
     
     	<fo:simple-page-master master-name="A3L"
    	margin-top="1cm" margin-bottom="1cm" margin-left="1cm" 
    	margin-right="1cm" page-height="29.7cm" 
                      page-width="42cm" >
     
    	<fo:region-body />
    	</fo:simple-page-master>
     
     
    </fo:layout-master-set>
     
    <fo:page-sequence id="N2528" master-reference="A3L">
     
      <fo:flow flow-name="xsl-region-body">
     
    	<!--
    	""""""""""""""""""""""""""""""""""""""""""""
    	LE CARTOUCHE DU HAUT
    	"""""""""""""""""""""""""""""""""""""""""""" 
    	-->
     
      <fo:table>
      	<fo:table-column column-width="2cm"/>
      	<fo:table-column column-width="0.5cm"/>
    	<fo:table-column column-width="34.5cm"/>
    	<fo:table-column column-width="3cm"/>
     
    		<fo:table-body> 
    			<fo:table-row>
     
    				<fo:table-cell>
    					<fo:block>
    					<fo:external-graphic src="url('file:D:\Tomcat4.1\webapps\CCGUEBWILLER_MYSQL\edition\logo\{PARAMETRES/PARAMETRE[@name='commune']/@value}.jpg')" height="2cm" width="2cm" text-align="right" />
    					</fo:block>
    				</fo:table-cell>
     
    				<fo:table-cell>
    					<fo:block>
     
    					</fo:block>
    				</fo:table-cell>
     
    				<fo:table-cell>
    					<fo:block color="#C6A1D1" margin-right="2cm" font-size="0.3cm" background-color="#C6A1D1" min-height="0.3cm">
    	     				 .
    					</fo:block>
     
    					<fo:block color="#FFFFFF" margin-right="2cm" font-size="0.1cm" background-color="#FFFFFF" min-height="0.3cm">
    	     				 .
    					</fo:block>
     
       					<fo:block font-size="12pt" color="#C3BDFB" font-family="Helvetica" text-align="left" font-weight="bold" space-before.maximum="0cm" space-after="0cm" >
        					Plan parcellaire de la commune de  <xsl:value-of select="PARAMETRES/PARAMETRE[@name='commune']/@value"/>
        					</fo:block>
     
        					<fo:block font-size="10pt" color="#C3BDFB" font-family="Helvetica" text-align="left" font-weight="bold" space-before.maximum="0cm" space-after="0cm" >
        					<xsl:if test="PARAMETRES/PARAMETRE[@name='lblechelle']">
    		   			Echelle : 1/<xsl:value-of select="CARTE[@name='map']/@scalecalc"/>ème
                				</xsl:if>
        					</fo:block>
     
    					<fo:block font-size="16pt"  font-weight="bold" space-before.maximum="0cm" space-after="0cm" >
    					<xsl:value-of select="PARAMETRES/PARAMETRE[@name='txtTitre']/@value"/>
    					</fo:block>
     
        				</fo:table-cell>
     
    				<fo:table-cell>
    					<fo:block>
    					<fo:external-graphic src="url('file:D:\Tomcat4.1\webapps\CCGUEBWILLER_MYSQL\edition\logo2.jpg')" height="2cm" content-width="3.5cm" />
    					</fo:block>
    				</fo:table-cell>
     
    			</fo:table-row>
    		</fo:table-body>
    	</fo:table>
     
     
    	<fo:table>
      	<fo:table-column column-width="40cm"/>
     
    		<fo:table-body> 
    			<fo:table-row>
     
    				<fo:table-cell>
    					<fo:block color="#C6A1D1" font-size="0.3cm" background-color="#ffffff" min-height="0.3cm">
    	     				 .
    					</fo:block>
    				</fo:table-cell>
     
    			</fo:table-row>
    		</fo:table-body>
    	</fo:table>
     
     
        <!--
    	""""""""""""""""""""""""""""""""""""""""""""
    	LA CARTE
    	"""""""""""""""""""""""""""""""""""""""""""" 
        -->
     
    	<fo:table>
    	<fo:table-column column-width="40cm"/>
    		<fo:table-body border-left-style="solid" border-right-style="solid" border-top-style="solid" border-bottom-style="solid" > 
    			<fo:table-row>
    				<fo:table-cell>
    					<fo:block id="N2531">
    	  				<fo:block>
    						<fo:external-graphic src="file:{CARTE[@name='map']/RESULTAT/ARCXML/RESPONSE/IMAGE/OUTPUT/@file}" height="21cm" width="40cm" mapblock="map" />
    					</fo:block>
    					</fo:block>
    				</fo:table-cell>
    			</fo:table-row>
    		</fo:table-body>
    	</fo:table>
     
        <!--
    	""""""""""""""""""""""""""""""""""""""""""""
    	LE CARTOUCHE DU BAS
    	"""""""""""""""""""""""""""""""""""""""""""" 
        -->
     
        <fo:table>
      	<fo:table-column column-width="1cm"/>
      	<fo:table-column column-width="37cm"/>
    	<fo:table-column column-width="2cm"/>
     
    		<fo:table-body> 
    			<fo:table-row>
     
    				<fo:table-cell>
    					<fo:block>
    					</fo:block>
    				</fo:table-cell>
     
     
    				<fo:table-cell>
     
    					<fo:block color="#FFFFFF" margin-right="2cm" font-size="0.1cm" background-color="#FFFFFF" min-height="0.3cm">
    	     				 .
    					</fo:block>
     
    					<fo:block color="#C6A1D1" margin-right="2cm" font-size="0.3cm" background-color="#C6A1D1" min-height="0.3cm">
    	     				 .
    					</fo:block>
     
    					<fo:block color="#FFFFFF" margin-right="2cm" font-size="0.1cm" background-color="#FFFFFF" min-height="0.3cm">
    	     				 .
    					</fo:block>
     
    					<fo:block margin-left="1cm" color="#C3BDFB" font-family="Helvetica" text-align="left">
     
    	   					<xsl:if test="PARAMETRES/PARAMETRE[@name='txtCommentaire']">
    	   						<fo:block font-size="9pt"  font-weight="bold" space-before.maximum="0cm" space-after="0cm" >
    		  					Commentaire : <xsl:value-of select="PARAMETRES/PARAMETRE[@name='txtCommentaire']/@value"/>
    	   						</fo:block>
    	   					</xsl:if>	
     
    	   						<fo:block font-size="8pt"   font-weight="bold" space-before.maximum="0cm" space-after="0cm" >
     
     
    								<xsl:if test="PARAMETRES/PARAMETRE[@name='lbldate']">
    	     	   						Date : <xsl:value-of select="SYSTEM/@date"/>
                							</xsl:if>
     
    	   						</fo:block>
     
     
      	   					<xsl:if test="PARAMETRES/PARAMETRE[@name='lblsource']">
    	   						<fo:block font-size="8pt" font-weight="bold" space-before.maximum="0cm" space-after="0cm" >
    		   					Source : <xsl:value-of select="PARAMETRES/PARAMETRE[@name='source']/@value"/>
    	   						</fo:block>
    	   					</xsl:if>
     
    	   					<fo:block color="#FFFFFF" margin-right="2cm" font-size="0.1cm" background-color="#FFFFFF" min-height="0.3cm">
    	     				 	.
    						</fo:block>
     
    	   					<fo:block padding="0pt" font-size="8pt" font-style="italic" text-align="left">
    						COMMUNAUTE DE COMMUNES DE
    						LA REGION DE GUEBWILLER
    						</fo:block>
    						<fo:block padding="0pt" font-size="8pt" font-style="italic" text-align="left">
    						1, rue des Malgre-Nous - BP 114
    						- 68502 GUEBWILLER Cedex
    						</fo:block>
     
       					</fo:block>	
    				</fo:table-cell>
     
    				<fo:table-cell>
    					<fo:block font-size="12pt" color="#C3BDFB" font-family="Helvetica" text-align="left" font-weight="bold" space-before.maximum="0cm" space-after="0cm" >
        					toto
        					</fo:block>
        				</fo:table-cell>
     
    			</fo:table-row>
    		</fo:table-body>
    	</fo:table>
     
    </fo:flow>
    </fo:page-sequence>
     
     
     
        <!--
    	""""""""""""""""""""""""""""""""""""""""""""
    	LA LEGENDE
    	"""""""""""""""""""""""""""""""""""""""""""" 
        -->
     
    <xsl:if test="PARAMETRES/PARAMETRE[@name='lbllegende']">
     
    <fo:page-sequence id="N2528" master-reference="A4P">
    <fo:flow flow-name="xsl-region-body">
     
          	  <fo:block font-family="Helvetica" font-size="24pt" text-align="center">
          	    LEGENDE
          	  </fo:block>
     
     
    	  <fo:block>
    	    <fo:external-graphic src="file:{CARTE[@name='map']/RESULTAT/ARCXML/RESPONSE/IMAGE/LEGEND/@file}"  />
    	  </fo:block>  
     
     
    </fo:flow>
    </fo:page-sequence>
    </xsl:if>
     
    </fo:root>
    </xsl:template>
     
    </xsl:stylesheet>
    Donc en fait tu constatera que la page est divisé en table. La carte est insérée dans la troisième table. Est-il possible de faire un background uniquement dans une table ? La carte ne devant pas recouvrir toute la page.

    Domage que je ne puisse pas insérrer le fichier pdf résultant ...

    En tous cas merci de ton aide en attendant ...

    Jean

  8. #8
    Membre expérimenté
    Avatar de virgul
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    1 625
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2004
    Messages : 1 625
    Points : 1 666
    Points
    1 666
    Par défaut
    Je précise que je ne suis pas le développeur de cette appli. Elle nous a été fourni par Esri France et je tatonne un peu pour essayer d'ajouter quelque petites chose, mais elle est complètement fonctionnelle.
    Y en a des qui ont de la chance!!!!


    Comme je te le disait le plus simple est de mettre ton image dans le background de ton tableau,de ton block, table-body ou même dans table-cell!


    Ex avec une table

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    soit <fo:table><xsl:attribute name="background-image"><xsl:value-of select="file:{CARTE[@name='map']/RESULTAT/ARCXML/RESPONSE/IMAGE/OUTPUT/@file}" /></xsl:attribute>
    ++
    "Life is short don't forget to inhale"
    Mais: "Mieux vaux arriver en retard dans ce monde... qu'en avance à l'autre."

Discussions similaires

  1. [css]superposer deux DIVs / opacity
    Par narkhor dans le forum Mise en page CSS
    Réponses: 1
    Dernier message: 13/03/2006, 02h38
  2. [xsl-fo][external-graphic]path relatif
    Par Invité dans le forum XSL/XSLT/XPATH
    Réponses: 1
    Dernier message: 12/01/2006, 13h29
  3. [xsl:fo] problème avec external-graphic
    Par jehlg dans le forum XSL/XSLT/XPATH
    Réponses: 2
    Dernier message: 11/10/2005, 11h57
  4. superposer deux images ?
    Par terminoz dans le forum Balisage (X)HTML et validation W3C
    Réponses: 7
    Dernier message: 20/08/2005, 09h04
  5. [FOP][XSL-FO] external-graphic : chemin issu du xml
    Par MrDuChnok dans le forum XSL/XSLT/XPATH
    Réponses: 2
    Dernier message: 21/06/2005, 17h13

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo