osm 2 pdf tool?


Is there any function/class/tool that can help me to export a map from my webpage to pdf (or svg/jpg)?


For a general PDF map, there’s http://www.maposmatic.org/ . It works best for a small area.

To create an image file for other uses, see http://wiki.openstreetmap.org/wiki/Static_map_images . Keep in mind that if you need to download many tiles to create the larger image, that you may be blocked - see the tile usage policy.

also have a look at Merkaartor and maybe Maperitive … how do they produce PDF?

And what do you mean with “a map from my webpage”? are there mapnik tiles, or where does the map come from?


Some WMS servers can output quite a good quality pdf files. Here are some examples. The Server is Mapserver 6.0 and data are OSM data, imported into PostGIS with osm2pgsql. These requests show only building and road layers and the map looks a bit odd but you should get an idea.

PNG output which shows the image on a browser:,roadsclose_03&TRANSPARENT=TRUE&FORMAT=image/png&BBOX=384624.91928819387,6670111.152621979,388398.2415827064,6672437.856548623&SRS=EPSG:3067&STYLES=

The same request as PDF. Save it on a disk, zoom in and look at the texts and building outlines.,roadsclose_03&TRANSPARENT=TRUE&FORMAT=application/x-pdf&BBOX=384624.91928819387,6670111.152621979,388398.2415827064,6672437.856548623&SRS=EPSG:3067&STYLES=

This one makes a geotiff file which includes an internal georeferencing info and therefore it opens automatically in a right place in GIS programs like QGis. OpenJUMP, MapInfo, ArcMap etc.,roadsclose_03&TRANSPARENT=TRUE&FORMAT=image/tiff&BBOX=384624.91928819387,6670111.152621979,388398.2415827064,6672437.856548623&SRS=EPSG:3067&STYLES=

No cached tiles, actually no tiles at all, and OpenLayers nor web Mercator projection.