I am using OpenLayers Tile layer fot my map application. I have WMS layers on map like this:
- Parcels,
- Streets,
- Buildings,
- Gas Pipes,
I zoom to somewhere on map that all layers are visible. I want to select a region within a rectangle and get view as an image. After get image, I want to put it to PDF. How can I do this?
Best Answer
Try the Geoserver print module http://docs.geoserver.org/latest/en/user/extensions/printing/index.html
First you have to download the print module (be sure to choose the correct version!) then unzip the downloaded content and put the files to your /WEB-INF/lib/ folder of your Geoserver installation.
Restart Geoserver and check if the config file was generated in YOUR_GEOSERVER_DATA_DIR/printing/config.yaml
If the printing module was installed properly you should be able to retrieve informations from your Geoserver about your print module: http://localhost:8080/geoserver/pdf/info.json
This response you can use to set a variable, lets call it "printCapabilities"
http://localhost:8080/geoserver/pdf/info.json?var=printCapabilities
and use this variable then in combination with GeoExt (http://geoext.org):
Here you will find several GeoExt-examples with printing functionality:
http://geoext.org/examples.html
or have a look at the newer Version GeoExt2:
http://geoext.github.io/geoext2/examples/printpreview/print-preview.html