Dear All,
I am using mapfish to print WMS layers from Geoserver 2.4.0. While printing WMS layers, Error appears in PDF file for some WMS layers.
The Error is:
java.io.IOException: The byte array is not a recognized imageformat.
If I am using the format “application/pdf”, everything is printed correctly but quality is very poor.
I am using below code to get print:
http://localhost:8080/geoserver/pdf/print.pdf?spec={
“layout”:“A3 portrait”,
“srs”:“EPSG:404000”,
“units”:“m”,
“dpi”:300,
“outputFilename”: “ggg”,
“layers”:[
{
“baseURL”:“http://localhost:8080/geoserver/cite/wms”,
“opacity”:1,
“singleTile”:false,
“type”:“WMS”,
“layers”:[“Oxford_Map”],
“format”:“image/png”,
“styles”:,
“overview”:true
},
{
“baseURL”:“http://localhost:8080/geoserver/cite/wms”,
“opacity”:1,
“singleTile”:true,
“customParams”:{“CQL_FILTER”: “User_id = 234”},
“type”:“WMS”,
“layers”:[“ODC_Graphics_Data”],
“format”:“image/png”,
“styles”:,
“overview”:false
},
{
“baseURL”:“http://localhost:8080/geoserver/cite/wms”,
“opacity”:1,
“singleTile”:true,
“customParams”:{“TRANSPARENT”:true,“buffer”: 0},
“type”:“WMS”,
“layers”:[“Plymouth_Buildings”],
“format”:“image/png”,
“styles”:,
“overview”:false
},
{
“baseURL”:“http://localhost:8080/geoserver/cite/wms”,
“opacity”:1,
“singleTile”:true,
“customParams”:{“TRANSPARENT”:true,“buffer”: 0.1},
“type”:“WMS”,
“layers”:[“Plymouth_Hard_Surface_Block_Paving”],
“format”:“image/png”,
“styles”:,
“overview”:false
},
{
“baseURL”:“http://localhost:8080/geoserver/cite/wms”,
“opacity”:1,
“singleTile”:true,
“customParams”:{“TRANSPARENT”:true,“buffer”: 0},
“type”:“WMS”,
“layers”:[“Plymouth_QUERIES”],
“format”:“image/png”,
“styles”:,
“overview”:false
},
{
“baseURL”:“http://localhost:8080/geoserver/cite/wms”,
“opacity”:1,
“singleTile”:true,
“customParams”:{“TRANSPARENT”:true,“buffer”: 0.1},
“type”:“WMS”,
“layers”:[“Plymouth_Street_Lights”],
“format”:“image/png”,
“styles”:,
“overview”:false
}
],
“pages”:[
{
“center”:[248744.93342196,55350.945],
“mapTitle”:“”,
“company”:“testuser2_portrait”,
“comment”:“”,
“scale”:439,
“rotation”:0
}
] }
And My Yaml Configuration is:
#===========================================================================
A3 portrait:
#===========================================================================
mainPage:
pageSize: A3
landscape: false
rotation: true
backgroundPdf: ‘D:\Oxford\ODC_Internal\PDF${company}.pdf’
header:
height: 1
items:
- !text
font: Helvetica
fontSize: 15
align: center
text: ‘${mapTitle}’
items: - !columns
absoluteX: 87
absoluteY: 1147
width: 735
config:
#borderWidth: 0.3
cells: - padding: 2
items: - !map
width: 500
height: 600
#width: 733
#height: 1124
Kindly help me to fix this issue. Thanks in Advance.