MapFish Print 3
Reporting meets maps
 
 
Tobias Sauerwein - Marion Baumgartner
Camptocamp
 
CAMPTOCAMP
Every spec for every web-mapping project
Req. #78:
Printing/PDF export
You got the choice
PRINT CSS STYLESHEETS
GENERATE PDF IN JAVASCRIPT
Using jsPDF ( )OpenLayers 3 example
GENERATE PDF WITH WKHTMLTOPDF
BUILD YOUR OWN
...
c.drawImage(self.logo, ...)
c.setFont('Helvetica', 24)
c.drawRightString(..., 'Report')
c.setFont('Helvetica', 9)
c.drawRightString(
    ..., time.strftime('Created at %d/%m/%Y %Hh%
c.setLineWidth(3)
c.setStrokeColor(report_blue)
c.line(0, 1, self.width, 1)
c.restoreState()
...
Checklist
Higher resolutions?
Page formats?
Supported geo-data?
Layouting/templates?
Client vs. server?
MAPFISH PRINT?
MAPFISH PRINT 3
Plugin Framework
MapFish Print
Web API / Security / Widgets
Mapping Layout
PRINT PROCESS
YAML CONFIGURATION
templates:
  A4 Portrait: !template
    reportTemplate: report.jrxml
    attributes:
      ...
    processors:
      ...
          
YAML CONFIGURATION (ATTRIBUTES)
templates:
  A4 Portrait: !template
    reportTemplate: report.jrxml
    attributes:
      title: !string {}
      map: !map
        width: 555
        height: 730
        maxDpi: 600
      scalebar: !scalebar
        width: 230
        height: 40
    processors:
      ...
          
YAML CONFIGURATION (PROCESSORS)
templates:
  A4 Portrait: !template
    reportTemplate: report.jrxml
    attributes:
      ...
    processors:
    ­ !reportBuilder
      directory: '.'
    ­ !createMap
      inputMapper: {map: map}
      outputMapper: {mapSubReport: mapSubReport}
    ­ !createScalebar {}
          
REPORT DESIGNER: JASPERSOFT STUDIO
PRINT REQUEST
{
  "layout": "A4 Portrait",
  "outputFormat": "pdf",
  "attributes": {
    "title": "Sample Print",
    "map": {
      "projection": "EPSG:3857",
      "dpi": 72,
      "center": [957352, 5936844],
      "scale": 25000,
      "layers": [
        { "type": "osm", "baseURL": "http://tile
      ]
    }
  }
}
MAP WIDGETS
SUPPORTED GEO-DATA
Vector
GML/WFS
GeoJSON
Raster
XYZ Tiles (OSM, ...)
(Tiled) WMS
WMTS
GeoTIFF
WE GOT STYLE!
Full GeoTools styling with SLD
JSON styling format
"[INTERSECTS(geometry, buffer(POLYGON (...), 200
  "symbolizers": [
    {
      "strokeColor": "green",
      "strokeWidth": 2,
      "type": "line"
    }
  ]
},
TABLES
SUPPORT FOR MULTIPLE MAPS (DATASOURCE)
CHARTS
EXTERNAL DATASOURCES
CLIENT SIDE SUPPORT
(OpenLayers 3/Angular):ngeo Example
:GeoExt 3 Example
PLUGGABLE ARCHITECTURE
MAPFISH PRINT 3
MapFish Print on GitHub
github.com/mapfish/mapfish-print
 
This presentation
bit.ly/foss4g-mfp
 
Find us on GitHub/Twitter
Tobias: @tsauerwein
Marion: @marionb
CREDITS FOR THESE GREAT PHOTOS!

MapFish Print 3