<!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é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é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émi Lagoin <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:remi.lagoin@gmail.com">remi.lagoin@gmail.com</a>></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émi Lagoin <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:remi.lagoin@gmail.com" target="_blank">remi.lagoin@gmail.com</a>></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>
// The printProvider that connects us to the print
service<br>
var printProvider = new
GeoExt.data.PrintProvider({<br>
method: "GET", // "POST" 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: "Printing Demo",<br>
comment: "This is a simple map printed
from GeoExt.",<br>
copyright: "This is a simple map printed
from GeoExt."<br>
}<br>
});<br>
<br>
feux = new OpenLayers.Layer.WMS("feux", "<a
moz-do-not-send="true" href="http://xxxx/feux"
target="_blank">http://xxxx/feux</a>",<br>
{layers: "feux", format: 'image/jpeg',
transparent: true}, {singleTile: true});<br>
<br>
// The map we want to print<br>
mapPanel = new GeoExt.MapPanel({<br>
region: "center",<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: "west",<br>
width: 150,<br>
bodyStyle: "padding:5px",<br>
layerStore: mapPanel.layers,<br>
defaults: {<br>
style: 'padding:5px',<br>
baseParams: {<br>
FORMAT: 'image/png',<br>
LEGEND_OPTIONS: 'forceLabels:on'<br>
}<br>
}<br>
<br>
});<br>
<br>
mapPanel.map.addControl(new
OpenLayers.Control.LayerSwitcher());<br>
<br>
var includeLegend; // controlled by the "Include
legend?" checkbox<br>
<br>
// The main panel<br>
new Ext.Panel({<br>
renderTo: "content",<br>
layout: "border",<br>
width: 700,<br>
height: 420,<br>
items: [mapPanel, legendPanel],<br>
bbar: ["->", {<br>
text: "Print",<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 && {legend:
legendPanel});<br>
}<br>
}, {<br>
xtype: "checkbox",<br>
boxLabel: "Include legend?",<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:
<div><br>
- !legends<br>
maxIconWidth: 0<br>
maxIconHeight: 0<br>
classIndentation: 0<br>
layerSpace: 5<br>
layerFontSize: 10<br>
<br>
<br>
</div>
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"><<a moz-do-not-send="true"
href="mailto:ahocevar@opengeo.org"
target="_blank">ahocevar@opengeo.org</a>></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>
maxIconWidth: 0<br>
maxIconHeight: 0<br>
classIndentation: 0<br>
layerSpace: 5<br>
layerFontSize: 10<br>
<br>
Regards,<br>
Andreas.<br>
<div>
<div><br>
On Dec 13, 2010, at 18:10 , Rémi Lagoin
wrote:<br>
<br>
> Hi all,<br>
><br>
> I try to use the form print PDF
GeoExt based servlet mapfish geoext as in
the example (1).<br>
> 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>
><br>
> 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>
><br>
> I also tried the
Geoext.ux.SimplePrint, but no more success
... it gives me no icons layers ...<br>
><br>
> 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>
><br>
> Do you have any advice for me because
I do not know what to do to move forward
...<br>
><br>
> Thanks a lot!<br>
> Remi<br>
><br>
</div>
</div>
> 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>
> Users mailing list<br>
> <a moz-do-not-send="true"
href="mailto:Users@geoext.org"
target="_blank">Users@geoext.org</a><br>
> <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>