[Geoserver-users] Print Community Module - is it different than the Mapfish print server?

Hello again,

I finally decided to try the community module after several years using the Mapfish print server war in Tomcat.

Seems to almost work, but not quite. Is it different than the Mapfish version?

Basically, I try this URL with a basic spec and the community module: (try it yourself)

http://204.62.18.181/geoserver/pdf/print.pdf?spec={layout: ‘Letter landscape’,title: ‘A simple example’,srs: ‘EPSG:900913’,units: ‘meters’,‘forwardHeaders’:,outputFilename: ‘OKMaps_Print.PDF’,outputFormat: ‘pdf’,layers: [{type: ‘WMS’,format: ‘image/png’,layers: [‘ogi:okcounties’],baseURL: ‘http://204.62.18.181/geoserver/wms’,customParams: { TRANSPARENT: true }}],pages: [{center: [-10964969.841611, 4230671.17964707],scale: 4000000,dpi: 190,mapTitle: ‘OKMaps’,comment: ‘’,data: [{ id: 1, name: ‘blah’, icon: ‘icon_pan’ },{ id: 2, name: ‘blip’, icon: ‘icon_zoomin’ }]}]}

and get not much of a map.

Then I try it in the latest from (https://github.com/geosolutions-it/mapfish-print) :

http://204.62.18.181/print-servlet-2.0-SNAPSHOT_GS/pdf/print.pdf?spec={layout: ‘Letter landscape’,title: ‘A simple example’,srs: ‘EPSG:900913’,units: ‘meters’,‘forwardHeaders’:,outputFilename: ‘OKMaps_Print.PDF’,outputFormat: ‘pdf’,layers: [{type: ‘WMS’,format: ‘image/png’,layers: [‘ogi:okcounties’],baseURL: ‘http://204.62.18.181/geoserver/wms’,customParams: { TRANSPARENT: true }}],pages: [{center: [-10964969.841611, 4230671.17964707],scale: 4000000,dpi: 190,mapTitle: ‘OKMaps’,comment: ‘’,data: [{ id: 1, name: ‘blah’, icon: ‘icon_pan’ },{ id: 2, name: ‘blip’, icon: ‘icon_zoomin’ }]}]}

Exact same spec, exact same config.yaml, different results.

Here is the yaml:

#===========================================================================

allowed DPIs

#===========================================================================
dpis:

  • 254
  • 190
  • 127
  • 56

#===========================================================================

allowed Formats

#===========================================================================

‘*’ means any formats

formats: [‘*’]

#===========================================================================

the allowed scales

#===========================================================================
scales:

  • 25000
  • 50000
  • 100000
  • 200000
  • 500000
  • 1000000
  • 2000000
  • 4000000
  • 8000000
  • 16000000
  • 32000000
  • 64000000

#===========================================================================

the list of allowed hosts

#===========================================================================
hosts:

the default fileName for the files downloaded from the servlet

outputFilename: MapFish_PrintOut

layouts:
#===========================================================================
Letter portrait:
#===========================================================================
mainPage:
rotation: true
pageSize: letter
header:
height: 50
items:

  • !text
    font: Helvetica
    fontSize: 30
    align: right
    text: ‘${mapTitle}’
    items:
  • !map
    spacingAfter: 30
    width: 440
    height: 483
  • !text
    text: ‘${comment}’
    spacingAfter: 30
    footer:
    height: 30
    items:
  • !columns
    items:
  • !text
    backgroundColor: #FF0000
    align: left
    text: OKMaps Map Print
  • !text
    align: right
    text: ‘Page ${pageNum}’
    #===========================================================================
    Letter landscape:
    #===========================================================================
    mainPage:
    rotation: true
    landscape: true
    pageSize: letter
    header:
    height: 50
    items:
  • !image
    maxWidth: 100
    align: right
    url: http://ogi.state.ok.us/OGI/images/okmaps_logo_90px.png
  • !image
    maxWidth: 15
    align: right
    url: http://ogi.state.ok.us/OGI/images/north_arrow.png
    items:
  • !map
    spacingAfter: 30
    width: 583
    height: 440
    align: left
  • !scalebar
    maxSize: 150
    type: line
    units: ft
    align: left
  • !legends
    maxIconWidth: 8
    maxIconHeight: 8
    footer:
    height: 30
    items:
  • !columns
    items:
  • !text
    backgroundColor: #FF0000
    align: left
    text: OKMaps Map Print

#===========================================================================
A4 portrait:
#===========================================================================

override the default outputFileName defined above

outputFilename: A4_Layout

mainPage:
rotation: true
pageSize: A4
header:
height: 50
items:

  • !text
    font: Helvetica
    fontSize: 30
    align: right
    text: ‘${mapTitle}’
    items:
  • !map
    spacingAfter: 30
    width: 440
    height: 483
  • !text
    text: ‘${comment}’
    spacingAfter: 30
    footer:
    height: 30
    items:
  • !columns
    items:
  • !text
    backgroundColor: #FF0000
    align: left
    text: Copyright Camptocamp SA
  • !text
    align: right
    text: ‘Page ${pageNum}’

Thanks!
Roger

Hi Roger,

···

2014-04-08 17:33 GMT+02:00 Roger Bedell <sylvanascent@anonymised.com>:

Hello again,

I finally decided to try the community module after several years using the Mapfish print server war in Tomcat.

Seems to almost work, but not quite. Is it different than the Mapfish version?

Yes and no. It’s simply using an old (1.2) version of MapFish.
The good news is that we are working to upgrade to the latest stable mapfish print-lib (2.0.0) and promote the module to an official Geoserver extension.
The difference you are experiencing is probably due to a config.yaml that is not compatible with the old version.

Mauro

Thanks Mauro,

That explains it. I need some 2.0 functionality (I think), so I’ll wait.

I’m a little confused, will the enhancements mentioned here:

http://www.geo-solutions.it/blog/developers-corner-improving-printing-for-geoserver-part-2/

be part of the extension?

Regards,
Roger

···

On Tue, Apr 8, 2014 at 5:46 PM, Mauro Bartolomeoli <mauro.bartolomeoli@anonymised.com> wrote:

Hi Roger,

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


2014-04-08 17:33 GMT+02:00 Roger Bedell <sylvanascent@anonymised.com>:

Hello again,

I finally decided to try the community module after several years using the Mapfish print server war in Tomcat.

Seems to almost work, but not quite. Is it different than the Mapfish version?

Yes and no. It’s simply using an old (1.2) version of MapFish.
The good news is that we are working to upgrade to the latest stable mapfish print-lib (2.0.0) and promote the module to an official Geoserver extension.
The difference you are experiencing is probably due to a config.yaml that is not compatible with the old version.

Mauro