I am an absolute novice when it comes to GeoServer and MapFish but have set myself the task of obtaining a GIF print output rather than PDF. From reading documentation and forums it seems this is possible, and I have a config.yaml with output formats defined (snippet below) but they are not being displayed when I go to my local GeoServer installation.

Config.yaml #=========================================================================== # allowed DPIs #===========================================================================

dpis: [75, 150, 300, 600]

# the allowed scales
  - 25000
  - 50000
  - 100000
  - 200000
  - 500000

# the list of allowed formats
outputFormats: ['pdf', 'png', 'gif']

JSON result from my localserver/geoserver/pdf/info.json

{"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"},{"name":"600","value":"600"}],"layouts":[{"name":"A4 portrait","map":{"width":440,"height":483},"rotation":true},{"name":"Legal","map":{"width":440,"height":483},"rotation":false}],"printURL":"localserver/geoserver/pdf/print.pdf","createURL":localserver/geoserver/pdf/create.json"}

From looking at the documentation at http://www.mapfish.org/doc/print/protocol.html I would expect these formats to be defined in this JSON string. I have not set about creating a request yet to see if I can print a GIF.

The version of Geoserver is 2.2.5 patched to 2.2.xx with a 2.2-SNAPSHOT version of Mapfish. I have the demo from GeoServer working correctly and pdfs being generated, but really need GIFs otherwise MapFish is a none starter.


1 Answer 1


Add formats: [pdf, png, gif] to your config.yaml of your printing.

Place it somewhere like

  dpis: [75, 150, 300, 600]
  formats: [pdf, png, gif]

However, after you will enable the parameter, you will probably face the problem

java.lang.NoClassDefFoundError: org/apache/pdfbox/pdmodel/PDDocument

so you have to download pdfbox-1.8.19.jar and fontbox-1.8.10.jar (versions numbers may be differents, those tho worked for me but not the earlies like 0.7.3 and so on) from maven website and place them to the geoserver's web--inf/lib folder (the same manner as you did when installed the print plugin).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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