Thanks Andreas,<br><br><span id="result_box" class="" lang="en"><span style="" title="">I
 also tried this example, the legendPanel works well, printing the PDF 
is done, but I only have the layer name in the caption, not the legend image associated.</span></span><br><br>Here is my code :<br><br>--------------<br>var mapPanel, printPage;<br><br>Ext.onReady(function() {<br>    // The printProvider that connects us to the print service<br>
    var printProvider = new GeoExt.data.PrintProvider({<br>        method: &quot;GET&quot;, // &quot;POST&quot; recommended for production use<br>        capabilities: printCapabilities // from the info.json script in the html<br>
    });<br>    // Our print page. Tells the PrintProvider about the scale and center of<br>    // our page.<br>    printPage = new GeoExt.data.PrintPage({<br>        printProvider: printProvider,<br>        customParams: {<br>
            mapTitle: &quot;Printing Demo&quot;,<br>            comment: &quot;This is a simple map printed from GeoExt.&quot;,<br>            copyright: &quot;This is a simple map printed from GeoExt.&quot;<br>        }<br>
    });<br>    <br>    feux = new OpenLayers.Layer.WMS(&quot;feux&quot;, &quot;<a href="http://xxxx/feux">http://xxxx/feux</a>&quot;,<br>            {layers: &quot;feux&quot;, format: &#39;image/jpeg&#39;, transparent: true}, {singleTile: true});<br>
            <br>   // The map we want to print<br>    mapPanel = new GeoExt.MapPanel({<br>        region: &quot;center&quot;,<br>        layers: [feux],<br>        center: [146.56, -41.56],<br>        zoom: 6<br>    });<br>
<br>    // The legend to optionally include on the printout<br>    var legendPanel = new GeoExt.LegendPanel({<br>        region: &quot;west&quot;,<br>        width: 150,<br>        bodyStyle: &quot;padding:5px&quot;,<br>        layerStore: mapPanel.layers,<br>
        defaults: {<br>        style: &#39;padding:5px&#39;,<br>        baseParams: {<br>            FORMAT: &#39;image/png&#39;,<br>            LEGEND_OPTIONS: &#39;forceLabels:on&#39;<br>        }<br>    }<br><br>    });<br>
    <br>    mapPanel.map.addControl(new OpenLayers.Control.LayerSwitcher());<br>    <br>    var includeLegend; // controlled by the &quot;Include legend?&quot; checkbox<br>     <br>    // The main panel<br>    new Ext.Panel({<br>
        renderTo: &quot;content&quot;,<br>        layout: &quot;border&quot;,<br>        width: 700,<br>        height: 420,<br>        items: [mapPanel, legendPanel],<br>        bbar: [&quot;-&gt;&quot;, {<br>            text: &quot;Print&quot;,<br>
            handler: function() {<br>                // convenient way to fit the print page to the visible map area<br>                printPage.fit(mapPanel, true);<br>                // print the page, optionally including the legend<br>
                printProvider.print(mapPanel, printPage, includeLegend &amp;&amp; {legend: legendPanel});<br>            }<br>        }, {<br>            xtype: &quot;checkbox&quot;,<br>            boxLabel: &quot;Include legend?&quot;,<br>
            handler: function() {includeLegend = this.checked}<br>        }]<br>    });<br>});<br>-----------<br>And an extract of my Yaml config :<br><br>       - !columns<br>           widths: [100]<br>           absoluteX: 300<br>
           spacingAfter: 5<br>           items:<br>            - !legends<br>               maxIconWidth: 0<br>               maxIconHeight: 0<br>               classIndentation: 0<br>               layerSpace: 5<br>               layerFontSize: 10<br>
<br><br>Is something wrong ?<br><br>Thanks a lot,<br><br>Rémi<br><br><br><br><div class="gmail_quote">2010/12/13 Andreas Hocevar <span dir="ltr">&lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
have you tried to do something like in this example in your code:<br>
<a href="http://api.geoext.org/1.0/examples/print-page.html" target="_blank">http://api.geoext.org/1.0/examples/print-page.html</a><br>
<br>
The essential part is to call the PrintProvider&#39;s print method with an additional option, e.g.<br>
<br>
printProvider.print(mapPanel, printPage, {legend: legendPanel});<br>
<br>
Also note that it is required to configure the server&#39;s config.yaml accordingly, as described here:<br>
<a href="http://api.geoext.org/1.0/docs/lib/GeoExt/data/PrintProvider.html" target="_blank">http://api.geoext.org/1.0/docs/lib/GeoExt/data/PrintProvider.html</a><br>
<br>
- !legends<br>
    maxIconWidth: 0<br>
    maxIconHeight: 0<br>
    classIndentation: 0<br>
    layerSpace: 5<br>
    layerFontSize: 10<br>
<br>
Regards,<br>
Andreas.<br>
<div><div></div><div class="h5"><br>
On Dec 13, 2010, at 18:10 , Rémi Lagoin wrote:<br>
<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I try to use the form print PDF GeoExt based servlet mapfish geoext as in the example (1).<br>
&gt; The PDF generation is going well but I can not get the icons of the layers in the legend, I get only the name of the active layers.<br>
&gt;<br>
&gt; I use a TreePanel (with captions for each layer), a legendPanel (because I assume that its presence is essential to display the caption in the PDF?), And a MapPanel (required I guess).<br>
&gt;<br>
&gt; I also tried the Geoext.ux.SimplePrint, but no more success ... it gives me no icons layers ...<br>
&gt;<br>
&gt; The inclusion of the legend went very well with the widget mapfish (LayerTree) I feel that this is not so simple with a TreePanel and legendPanel ...<br>
&gt;<br>
&gt; Do you have any advice for me because I do not know what to do to move forward ...<br>
&gt;<br>
&gt; Thanks a lot!<br>
&gt; Remi<br>
&gt;<br>
</div></div>&gt; 1 - <a href="http://api.geoext.org/1.0/examples/print-form.html" target="_blank">http://api.geoext.org/1.0/examples/print-form.html</a> _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
&gt; <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
<br>
</font></blockquote></div><br>