Improved WMS, lots of corrections and adaptions of the pdf output

@kalbermattenm : Please review. cheers