I searched lots of places but I couldn't find proper examples or documentation to do printing using Mapfish Printing service or Wkhtmltopdf. My application has a few WFS layers from openlayers and geoserver only (no WMS). So is printing possible from the above two methods or not?
Also, I would like to add that I am using OpenStreetMap (OSM) as baselayer.
Actually, I am requesting mapfish printing (integrated with geoserver) service through url. Through my URL, I am getting wms layer in print out but not osm layer and also if you can tell me how I can request for geojson wfs layer through url?
Mapfish printing working properly and this is my info.json details:
{"scales":[{"name":"1:25,000","value":"25000"},{"name":"1:50,000","value":"50000"},
{"name":"1:100,000","value":"100000"},{"name":"1:200,000","value":"200000"},
{"name":"1:500,000","value":"500000"},{"name":"1:1,000,000","value":"1000000"},
{"name":"1:2,000,000","value":"2000000"},{"name":"1:4,000,000","value":"4000000"}],"dpis":
[{"name":"75","value":"75"},{"name":"150","value":"150"},
{"name":"300","value":"300"}],"layouts":[{"name":"A4 portrait","map":
{"width":440,"height":483},"rotation":true},{"name":"Legal","map":
{"width":440,"height":483},"rotation":false}],"printURL":"http://xxxxxxxxxxxx.xxxxxx.xxx:8080/geoserver/pdf/print.pdf","createURL":"http://xxxxxxxxxxxx.xxxxxxxx.xxx:8080/geoserver/pdf/create.json"}
Details for osm layer which I am requesting in url is:
{"baseURL":"http://tile.openstreetmap.org/",' +
'"opacity":1,' +
'"singleTile":false,' +
'"customParams":{},' +
'"type":"OSM",' +
'"extension":"png",'+
'"tiled":"false",'+
'"tileSize" : [256, 256],'+
'"maxExtent" : [-20037508.34,-20037508.34,20037508.34,20037508.34],'+
'"resolutions" : [19567.87923828125],'+
'}],' + //am getting error,could not be able to fetch tiles 404 error.
One more thing I would like to ask: is it feasible to have the same screenshot (display) on pdf which the user can see at that moment in browser and click for print request? Since I am using the service and reading it from server side, how can I get the pdf of what the user is seeing in client side if this is possible?