I've installed GeoServer's map printing module. I've tested that it works by following the instructions here. Now, I'm using GeoExt.PrintMapPanel, and my code is as shown below:
var mapPanel = new GeoExt.MapPanel({
renderTo: "mappanel",
map: map,
layers: [wms, gLayer, vector],
center: new OpenLayers.LonLat(21.0936111111, 7.18805555556),
zoom: 2.5,
tbar: toolbarItems,
bbar: [{
icon: "img/printer.png",
tooltip: "Print map",
handler: function() {
var printDialog = new Ext.Window({
autoHeight: true,
width: 350,
items: [new GeoExt.PrintMapPanel({
sourceMap: mapPanel,
printProvider: {
capabilities: printCapabilities
}
})],
bbar: [{
text: "Create PDF",
handler: function() {
printDialog.items.get(0).print();
}
}]
});
printDialog.show();
}
}]
});
where printCapabilities is http://localhost:8081/geoserver/pdf/info.json?var=printCapabilities, my local installation. I've written this by following the example here.
However, when I try printing, the following error is shown in GeoServer log:
org.mapfish.print.JsonMissingException: attribute [spec.pages[0].mapTitle] missing. Any idea on how I can solve this will be appreciated.