2

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
#===========================================================================
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 so any thoughts/pointers would be appreciated.

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.

Apologies in advance if I have incorrectly formatted parts or missed some vital piece of information out.

  • can you try modifing the config.yaml this way: dpis: -75 -150 -300 -600 formats: -pdf -png -gif Beware the spaces before format types. Let me know when you've done. Laura – Laura Jan 30 '14 at 10:13
  • I tired to do the same, it doesn't help, still see the pdf only in the json – Ilya Yevlampiev Dec 9 '15 at 21:48
  • wow! dpis: [75, 150, 300, 600] formats: [pdf, png, gif] helped – Ilya Yevlampiev Dec 9 '15 at 21:50
1

please 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]

hower 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, privacy policy and cookie policy

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