2

I have a leaflet web app displaying some WFS and WMS with tiles from the IGN in WMTS.

I've installed leaflet.print plugin and the geoserver printing module.

But, when I want to print, a web page is opening with :

1 Error while generating PDF:
2 com.itextpdf.text.DocumentException:org.mapfish.print.InvalidJsonValueException: spec.layers[0].baseURL has an invalid value: http://wxs.ign.fr/my key/wmts?LAYER=GEOGRAPHICALGRIDSYSTEMS.MAPS&EXCEPTIONS=text/xml&FORMAT=image/jpeg&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal&TILEMATRIXSET=PM&TILEMATRIX= (spec.layers[0].baseURL has an invalid value: http://wxs.ign.fr/my key/wmts?LAYER=GEOGRAPHICALGRIDSYSTEMS.MAPS&EXCEPTIONS=text/xml&FORMAT=image/jpeg&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal&TILEMATRIXSET=PM&TILEMATRIX=)

Any idea ?

Here is my config.yaml :

dpis: [75, 150, 300]

scales:
- 524288000
- 262144000
- 131072000
- 65536000
- 32768000
- 16384000
- 8192000
- 4096000
- 2048000
- 1024000
- 512000
- 256000
- 128000
- 64000
- 32000
- 16000
- 8000
- 4000
- 2000
- 1000

hosts:
- !localMatch
    dummy: true
- !ipMatch
    ip: 0.0.0.0
    mask: 0.0.0.0
- !dnsMatch
        host: http://wxs.ign.fr
- !key
        key: my key


layouts:

A4:
    metaData: &commonMetaData
        title: "${mapTitle}"
        author: "GeoExplorer"
        subject: "Map printed with the OpenGeo Suite"
        keywords: "map,print"
        creator: "OpenGeo Suite"
    mainPage:
        pageSize: A4
        rotation: true
        items:
            - !text
                text: "${mapTitle}"
                fontSize: 30
                spacingAfter: 30
                align: center
            - !map
                spacingAfter: 10
                width: 440
                height: 600
            - !scalebar
                type: bar
                maxSize: 100
                barBgColor: white
                fontSize: 8
                align: right
                spacingAfter: 10
            - !text
                text: "${comment}"

Legal:
    metaData: *commonMetaData
    mainPage:
        pageSize: LEGAL
        rotation: true
        items:
            - !text
                text: "${mapTitle}"
                fontSize: 30
                spacingAfter: 30
                align: center
            - !map
                spacingAfter: 10
                width: 440
                height: 650
            - !scalebar
                type: bar
                maxSize: 100
                barBgColor: white
                fontSize: 8
                align: right
                spacingAfter: 10
            - !text
                text: "${comment}"

Letter:
    metaData: *commonMetaData
    mainPage:
        pageSize: LETTER
        rotation: true
        items:
            - !text
                text: "${mapTitle}"
                fontSize: 30
                spacingAfter: 30
                align: center
            - !map
                spacingAfter: 10
                width: 440
                height: 550
            - !scalebar
                type: bar
                maxSize: 100
                barBgColor: white
                fontSize: 8
                align: right
                spacingAfter: 10
            - !text
                text: "${comment}"
6
  • 1
    looks like a stray ) on the end of the string – Ian Turton Dec 14 '15 at 9:38
  • Can you show your configuration file (from GEOSERVER_DATA_DIR/printing/config.yaml)? – BradHards Dec 14 '15 at 10:30
  • ok BradHards, I've edited my post with my config.yaml. I don't know what to put in, I've tried a !dnsMatch with the url of the tiles, and a !key with my access key to the tiles as I saw it in other posts. – Hippipers Dec 14 '15 at 10:36
  • I asked to the IGN and they said that the key has a security by referer. I'm working on localhost and my key security works only for localhost. Don't know how to set up this. I had a look at [link]"docs.geoserver.org/stable/en/user/extensions/printing/…" but i'm not sure I'm understanding everything ... – Hippipers Dec 16 '15 at 10:49
  • Did you eventually get this to work? – Samuel_NET Jul 6 '18 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.