[Geoserver-users] Printing in Geoserver

Hi all

I wasn’t sure of the best route to ask these questions, so please re-direct
me if this is the wrong place...

I have a few questions about the in-built printing that I hope someone can
help with:

1) I am struggling to use the functionality to result in a PDF with a basic
layout/legend, I can get an image with a legend (see links below), but a PDF
doesn’t work. Can anyone help tell me what I need to do to fix this? Thanks

http://ha2.boroughofpoole.com/geoserver/wms?LAYERS=Poole:WARDS_81989,Poole:SSSI_SRID&STYLES=&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:27700&BBOX=395337.896,87280.076,407229.698316626,97670.123&WIDTH=535&HEIGHT=700&format_options=layout:Poole_Basic

http://ha2.boroughofpoole.com/geoserver/wms?LAYERS=Poole:WARDS_81989,Poole:SSSI_SRID&STYLES=&format=application%2Fpdf&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:27700&BBOX=395337.896,87280.076,407229.698316626,97670.123&WIDTH=535&HEIGHT=700&format_options=layout:Poole_Basic
2) Another point to raise is that I can’t get a singular legend box for the
layers, currently (as shown in the first link) I get multiple boxes, one for
each layer – can this be changed in my xml file I create or is this a
development request?
3) I really like this basic printing capability and was wondering if it
could be made easier to manage/work with by including it in the overall
GeoServer Interface? Is there any desire to do this?

Thanks and apologies if I’ve sent this to the wrong place!

Steve

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Printing-in-Geoserver-tp5150144.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Steve,

···

2014-07-08 17:39 GMT+02:00 Steve Campbell <s.campbell@anonymised.com>:

Hi all

I wasn’t sure of the best route to ask these questions, so please re-direct
me if this is the wrong place…

I have a few questions about the in-built printing that I hope someone can
help with:

  1. I am struggling to use the functionality to result in a PDF with a basic
    layout/legend, I can get an image with a legend (see links below), but a PDF
    doesn’t work. Can anyone help tell me what I need to do to fix this? Thanks

http://ha2.boroughofpoole.com/geoserver/wms?LAYERS=Poole:WARDS_81989,Poole:SSSI_SRID&STYLES=&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:27700&BBOX=395337.896,87280.076,407229.698316626,97670.123&WIDTH=535&HEIGHT=700&format_options=layout:Poole_Basic

What you are using here is not a printing functionality, but rather the decoration one. This allows you to get an image from WMS with some layout, but it’s not meant to support complete printing capabilities.

You can get a pdf using the wms service (simply changing the format parameter from image/png to application/pdf) but unfortunately decorations are not supported by the pdf output format.

For real printing there is a printing plugin, that uses the MapFish-Print library (http://www.mapfish.org/doc/print/).

Currently the plugin is available as an extension for the 2.6.x (upcoming) release or as a community module (using an older version of mapfish-print libs) for 2.5.x and 2.4.x,. You can download it here:

2.6.x: http://ares.boundlessgeo.com/geoserver/master/ext-latest/geoserver-2.6-SNAPSHOT-printing-plugin.zip
2.5.x: http://ares.boundlessgeo.com/geoserver/2.5.x/community-latest/geoserver-2.5-SNAPSHOT-printing-plugin.zip
2.4.x: http://ares.boundlessgeo.com/geoserver/2.4.x/community-latest/geoserver-2.4-SNAPSHOT-printing-plugin.zip

Some documentation on the plugin and the related configuration can be found here:

2.6.x: http://docs.geoserver.org/latest/en/user/extensions/printing/index.html
previous versions: http://docs.geoserver.org/stable/en/user/community/printing/index.html

Cheers,
Mauro Bartolomeoli

Hi Mauro,
Is there a simple way to do printing with the print module? As in, just use a simple URL (as can be done with decorations) which will then provide a nice print - similar to what Steve expresses an interest in with his question 3.

As best I can tell, the print module requires a fairly complex front end system (typically GeoExt) to interact fully with the API. Is there a simpler way to get it to create prints? Ideally with a “simple” GET request.

Cheers,
Jonathan

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

···

On 8 July 2014 17:23, Mauro Bartolomeoli <mauro.bartolomeoli@anonymised.com> wrote:

Hi Steve,

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it



Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

2014-07-08 17:39 GMT+02:00 Steve Campbell <s.campbell@anonymised.com>:

Hi all

I wasn’t sure of the best route to ask these questions, so please re-direct
me if this is the wrong place…

I have a few questions about the in-built printing that I hope someone can
help with:

  1. I am struggling to use the functionality to result in a PDF with a basic
    layout/legend, I can get an image with a legend (see links below), but a PDF
    doesn’t work. Can anyone help tell me what I need to do to fix this? Thanks

http://ha2.boroughofpoole.com/geoserver/wms?LAYERS=Poole:WARDS_81989,Poole:SSSI_SRID&STYLES=&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:27700&BBOX=395337.896,87280.076,407229.698316626,97670.123&WIDTH=535&HEIGHT=700&format_options=layout:Poole_Basic

What you are using here is not a printing functionality, but rather the decoration one. This allows you to get an image from WMS with some layout, but it’s not meant to support complete printing capabilities.

You can get a pdf using the wms service (simply changing the format parameter from image/png to application/pdf) but unfortunately decorations are not supported by the pdf output format.

For real printing there is a printing plugin, that uses the MapFish-Print library (http://www.mapfish.org/doc/print/).

Currently the plugin is available as an extension for the 2.6.x (upcoming) release or as a community module (using an older version of mapfish-print libs) for 2.5.x and 2.4.x,. You can download it here:

2.6.x: http://ares.boundlessgeo.com/geoserver/master/ext-latest/geoserver-2.6-SNAPSHOT-printing-plugin.zip
2.5.x: http://ares.boundlessgeo.com/geoserver/2.5.x/community-latest/geoserver-2.5-SNAPSHOT-printing-plugin.zip
2.4.x: http://ares.boundlessgeo.com/geoserver/2.4.x/community-latest/geoserver-2.4-SNAPSHOT-printing-plugin.zip

Some documentation on the plugin and the related configuration can be found here:

2.6.x: http://docs.geoserver.org/latest/en/user/extensions/printing/index.html
previous versions: http://docs.geoserver.org/stable/en/user/community/printing/index.html

Cheers,
Mauro Bartolomeoli

On Tue, Jul 8, 2014 at 6:40 PM, Jonathan Moules <
jonathanmoules@anonymised.com> wrote:

Hi Mauro,
  Is there a simple way to do printing with the print module? As in, just
use a simple URL (as can be done with decorations) which will then provide
a nice print - similar to what Steve expresses an interest in with his
question 3.

As best I can tell, the print module requires a fairly complex front end
system (typically GeoExt) to interact fully with the API. Is there a
simpler way to get it to create prints? Ideally with a "simple" GET request.

Nope, there is not.
I once fancied setting up print templates in the form of SVG files, with
elements having IDs assigned to them, so that the code
would know where to put the legend, the map, where to expand the titles,
and then pass all the extra info needed via
url parameters, to get more or less what you're asking for.

However, most people interested in doing prints go for the print system,
which as you say provides a complex but nice
GUI for setting up the printout

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi Jonathan,

···

2014-07-08 18:40 GMT+02:00 Jonathan Moules <jonathanmoules@anonymised.com>:

Hi Mauro,
Is there a simple way to do printing with the print module? As in, just use a simple URL (as can be done with decorations) which will then provide a nice print - similar to what Steve expresses an interest in with his question 3.

As Andrea already answered, currently there is no way.
I can think of some ways to add this functionality:

  • a REST API for the printing plugin
  • a specific outputformat leveraging the printing plugin, able to create a printing spec from standard wms requests (with some format_options to specify layout and so on)
  • an extension to the existing application/pdf outputFormat to use the printing plugin if it is installed

Mauro

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it