2

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?

1

It seems that MapFish accepts well WFS as GeoJSON, never tried that though:

What are MapFish Printing Capabilities for WMS and WFS?

Since you're using Geoserver, you can try GeoExplorer, it may easily work for you:

http://workshops.boundlessgeo.com/suiteintro/geoexplorer/introduction.html

Check this also out:

How to edit using a WFS service, without showing it on the map in OpenLayers?

0

Is this what you are looking for ?

http://demo.mapfish.org/mapfishsample/2.2/

  • Thanks for replying @Below and i am sorry this will not help me but thanks anyway.Actually i wanted working examples and documentation that how to do printing with the help of Mapfish or wkhtmltopdf(Integration with openlayers and geoserver). Since i already tried these two methods but without success.If u have any links for that then that would be very helpful,thanks in advance. – Akash Mar 6 '14 at 4:53
  • every info you need is in this demo. If you have particular problems, please edit your question and provide details on what you have done so far and what is not working. Good Luck! – Below the Radar Mar 6 '14 at 14:23
  • 1
    Thanks again for replying @Below,I tried to give information as much as i can, if something not explainable then please do tell me. Thanks – Akash Mar 7 '14 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.