I am in the process of developing a webGIS application using GeoServer (2.1.1), GeoWebCache(1.2.6), OpenLayers(2.11), GeoExt. All my layers are served as wms through GeoWebCache. A sample definition for any layer is as follows:
var My_Layer = new OpenLayers.Layer.WMS( "My_Layer",
"http://my-ip + my-port/geoserver/gwc/service/wms",
{layers: 'layer-name',transparent: "true",format: "image/png",
tileSize: new OpenLayers.Size(256,256),
tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom },
{ isBaseLayer: false, visibility:false} );
Everything was working fine, till this point. But, when I planned to move a bit ahead and tried implementing MapFish Printing module...... the output pdf is blank!!! I am getting the following error message:
java.io.IOException: Error (status=400) while reading the image from........
I have searched a lot. According to this one option is to access my layers as TMS layer. But I don't want a static image layer, instead of a GeoServer WMS map layer.
Again another option found here is using OpenLayers.Control.ExportMap(). But that restricts using different scales, since my data extent is too big . As a result at a specific scale if user wants to take a print of the entire map area(may be in an A0 paper), which is not visible fully in the Openlayers div, this can not solve the purpose.
So the question is how can I accomplish this, without using a TMS or GeoWebCache layer?
Edit # 1 : Sorry I am late, as I was out of office. Following is my config.yaml file. I feel there is no error, this can print my WMS layers, coming directly from GeoServer.
dpis: [75, 150, 300]
outputFormats:
- pdf
scales:
- 10000
- 25000
- 50000
- 100000
hosts:
- !localMatch
dummy: true
- !ipMatch
ip: www.camptocamp.org
- !dnsMatch
host: labs.metacarta.com
port: 80
- !dnsMatch
host: terraservice.net
port: 80
- !dnsMatch
host: sigma.openplans.org
- !dnsMatch
host: demo.mapfish.org
layouts:
A4 portrait:
metaData:
title: 'Arunava TopoMap PDF'
author: 'Arunava print module'
subject: 'Map layout'
keywords: 'map,print'
creator: 'Arunava'
mainPage:
pageSize: A4
rotation: true
items:
- !text
text: '${mapTitle} ${now MM.dd.yyyy}'
fontSize: 20
spacingAfter: 30
- !map
spacingAfter: 30
width: 440
height: 600
- !scalebar
type: bar
maxSize: 100
barBgColor: white
fontSize: 8
align: right
- !text
font: Helvetica
fontSize: 9
align: right
text: '1:${scale}'
footer: *commonFooter
A2 portrait:
metaData:
title: 'Arunava TopoMap PDF'
author: 'Arunava print module'
subject: 'Map layout'
keywords: 'map,print'
creator: 'Arunava'
mainPage:
pageSize: A2
rotation: true
items:
- !text
text: '${mapTitle} ${now MM.dd.yyyy}'
fontSize: 20
spacingAfter: 30
- !map
spacingAfter: 30
width: 880
height: 1200
- !scalebar
type: bar
maxSize: 100
barBgColor: white
fontSize: 8
align: right
- !text
font: Helvetica
fontSize: 9
align: right
text: '1:${scale}'
footer: *commonFooter