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:
  - !localMatch
    dummy: true
  - !ipMatch
    ip: www.camptocamp.org
  - !dnsMatch
    host: labs.metacarta.com
    port: 80
  - !dnsMatch
    host: demo.mapfish.org
    port: 80

# 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
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to