<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi R&eacute;mi,<br>
    <br>
    Use Fiddler or FireBug to capture the JSON that is being sent to
    your server. This includes a legends property such as:<br>
    <br>
    "legends":[{"name":"My
    Layer","classes":[{"name":"","icons":["<a class="moz-txt-link-freetext" href="http://url.to.icon">http://url.to.icon</a>.....<br>
    <br>
    Take the URL to the icon and see if you can access it correctly on
    the print server. I had an of issue where the URL passed to the
    print program pointed to the server's external URL which was not
    accessible from the server itself. <br>
    <br>
    Regards,<br>
    <br>
    Seth G. <br>
    <br>
    On 15/12/2010 12:05, R&eacute;mi Lagoin wrote:
    <blockquote
      cite="mid:AANLkTincxp_7N+kK475O-eJmGxrMK0zxgw0OVoBFBUSt@mail.gmail.com"
      type="cite"><span id="result_box" class="" lang="en"><span
          title="Cliquer ici pour voir d'autres traductions" class="hps
          atn">[</span><span class="" title="Cliquer ici pour voir
          d'autres traductions">Sorry</span><span title="Cliquer ici
          pour voir d'autres traductions">,</span> <span title="Cliquer
          ici pour voir d'autres traductions" class="hps">it</span><span
          class="" title="Cliquer ici pour voir d'autres traductions">'s</span>
        <span title="Cliquer ici pour voir d'autres traductions"
          class="hps">Better</span> <span title="Cliquer ici pour voir
          d'autres traductions" class="hps">in</span> <span
          title="Cliquer ici pour voir d'autres traductions" class="hps">English</span><span
          title="Cliquer ici pour voir d'autres traductions">]</span><br>
        <br>
        <span title="Cliquer ici pour voir d'autres traductions"
          class="hps">No</span> <span title="Cliquer ici pour voir
          d'autres traductions" class="hps">progress</span> <span
          title="Cliquer ici pour voir d'autres traductions" class="hps">today</span>
        <span title="Cliquer ici pour voir d'autres traductions"
          class="hps">...</span> <span title="Cliquer ici pour voir
          d'autres traductions" class="hps">any help</span> <span
          title="Cliquer ici pour voir d'autres traductions" class="hps">is</span>
        <span title="Cliquer ici pour voir d'autres traductions"
          class="hps">welcome</span><span title="Cliquer ici pour voir
          d'autres traductions">:</span><span class="" title="Cliquer
          ici pour voir d'autres traductions">)</span></span><br>
      <br>
      <div class="gmail_quote">2010/12/15 R&eacute;mi Lagoin <span dir="ltr">&lt;<a
            moz-do-not-send="true" href="mailto:remi.lagoin@gmail.com">remi.lagoin@gmail.com</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;">
          Pas de progression aujourd'hui ... toute aide est bienvenue :)<br>
          <br>
          <div class="gmail_quote">2010/12/14 R&eacute;mi Lagoin <span
              dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:remi.lagoin@gmail.com" target="_blank">remi.lagoin@gmail.com</a>&gt;</span>
            <div>
              <div class="h5"><br>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt
                  0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  padding-left: 1ex;">
                  Thanks Andreas,<br>
                  <br>
                  <span lang="en"><span 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>
                  &nbsp;&nbsp;&nbsp; // The printProvider that connects us to the print
                  service<br>
                  &nbsp;&nbsp;&nbsp; var printProvider = new
                  GeoExt.data.PrintProvider({<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; method: "GET", // "POST" recommended for
                  production use<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; capabilities: printCapabilities // from the
                  info.json script in the html<br>
                  &nbsp;&nbsp;&nbsp; });<br>
                  &nbsp;&nbsp;&nbsp; // Our print page. Tells the PrintProvider about
                  the scale and center of<br>
                  &nbsp;&nbsp;&nbsp; // our page.<br>
                  &nbsp;&nbsp;&nbsp; printPage = new GeoExt.data.PrintPage({<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printProvider: printProvider,<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; customParams: {<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mapTitle: "Printing Demo",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comment: "This is a simple map printed
                  from GeoExt.",<br>
                  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; copyright: "This is a simple map printed
                  from GeoExt."<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                  &nbsp;&nbsp;&nbsp; });<br>
                  &nbsp;&nbsp;&nbsp; <br>
                  &nbsp;&nbsp;&nbsp; feux = new OpenLayers.Layer.WMS("feux", "<a
                    moz-do-not-send="true" href="http://xxxx/feux"
                    target="_blank">http://xxxx/feux</a>",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {layers: "feux", format: 'image/jpeg',
                  transparent: true}, {singleTile: true});<br>
                  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
                  &nbsp;&nbsp; // The map we want to print<br>
                  &nbsp;&nbsp;&nbsp; mapPanel = new GeoExt.MapPanel({<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; region: "center",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layers: [feux],<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; center: [146.56, -41.56],<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zoom: 6<br>
                  &nbsp;&nbsp;&nbsp; });<br>
                  <br>
                  &nbsp;&nbsp;&nbsp; // The legend to optionally include on the
                  printout<br>
                  &nbsp;&nbsp;&nbsp; var legendPanel = new GeoExt.LegendPanel({<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; region: "west",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width: 150,<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bodyStyle: "padding:5px",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layerStore: mapPanel.layers,<br>
                  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; defaults: {<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; style: 'padding:5px',<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; baseParams: {<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FORMAT: 'image/png',<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LEGEND_OPTIONS: 'forceLabels:on'<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                  &nbsp;&nbsp;&nbsp; }<br>
                  <br>
                  &nbsp;&nbsp;&nbsp; });<br>
                  &nbsp;&nbsp;&nbsp; <br>
                  &nbsp;&nbsp;&nbsp; mapPanel.map.addControl(new
                  OpenLayers.Control.LayerSwitcher());<br>
                  &nbsp;&nbsp;&nbsp; <br>
                  &nbsp;&nbsp;&nbsp; var includeLegend; // controlled by the "Include
                  legend?" checkbox<br>
                  &nbsp;&nbsp;&nbsp;&nbsp; <br>
                  &nbsp;&nbsp;&nbsp; // The main panel<br>
                  &nbsp;&nbsp;&nbsp; new Ext.Panel({<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; renderTo: "content",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layout: "border",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width: 700,<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height: 420,<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; items: [mapPanel, legendPanel],<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bbar: ["-&gt;", {<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text: "Print",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler: function() {<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // convenient way to fit the print
                  page to the visible map area<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printPage.fit(mapPanel, true);<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // print the page, optionally
                  including the legend<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printProvider.print(mapPanel,
                  printPage, includeLegend &amp;&amp; {legend:
                  legendPanel});<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }, {<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xtype: "checkbox",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boxLabel: "Include legend?",<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler: function() {includeLegend =
                  this.checked}<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }]<br>
                  &nbsp;&nbsp;&nbsp; });<br>
                  });<br>
                  -----------<br>
                  And an extract of my Yaml config :<br>
                  <br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - !columns<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; widths: [100]<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; absoluteX: 300<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; spacingAfter: 5<br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; items:
                  <div><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - !legends<br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maxIconWidth: 0<br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maxIconHeight: 0<br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; classIndentation: 0<br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layerSpace: 5<br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layerFontSize: 10<br>
                    <br>
                    <br>
                  </div>
                  Is something wrong ?<br>
                  <br>
                  Thanks a lot,<br>
                  <br>
                  R&eacute;mi<br>
                  <br>
                  <br>
                  <br>
                  <div class="gmail_quote">2010/12/13 Andreas Hocevar <span
                      dir="ltr">&lt;<a moz-do-not-send="true"
                        href="mailto:ahocevar@opengeo.org"
                        target="_blank">ahocevar@opengeo.org</a>&gt;</span>
                    <div>
                      <div><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 moz-do-not-send="true"
                            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'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's config.yaml accordingly, as described
                          here:<br>
                          <a moz-do-not-send="true"
                            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>
                          &nbsp; &nbsp;maxIconWidth: 0<br>
                          &nbsp; &nbsp;maxIconHeight: 0<br>
                          &nbsp; &nbsp;classIndentation: 0<br>
                          &nbsp; &nbsp;layerSpace: 5<br>
                          &nbsp; &nbsp;layerFontSize: 10<br>
                          <br>
                          Regards,<br>
                          Andreas.<br>
                          <div>
                            <div><br>
                              On Dec 13, 2010, at 18:10 , R&eacute;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 moz-do-not-send="true"
                            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 moz-do-not-send="true"
                            href="mailto:Users@geoext.org"
                            target="_blank">Users@geoext.org</a><br>
                          &gt; <a moz-do-not-send="true"
                            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 moz-do-not-send="true"
                              href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
                            Expert service straight from the developers.<br>
                            <br>
                          </font></blockquote>
                      </div>
                    </div>
                  </div>
                  <br>
                </blockquote>
              </div>
            </div>
          </div>
          <br>
        </blockquote>
      </div>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@geoext.org">Users@geoext.org</a>
<a class="moz-txt-link-freetext" href="http://www.geoext.org/cgi-bin/mailman/listinfo/users">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>