[OpenLayers-Users] Print support

Christopher Schmidt crschmidt at metacarta.com
Wed Feb 14 14:50:41 EST 2007


On Wed, Feb 14, 2007 at 11:43:27AM -0800, Brock Anderson wrote:
> Hi Folks,
> 
> Does OpenLayers presently have any support for printing?
> 
> I am interested either in the ability to use a web browser's standard 
> print functionality to make a hard copy of the page (map and all), or 
> the ability to export (the map only) as a PDF. 
> 
> A recent test with the OL Vector branch and Firefox 1.5.x got me a blank 
> rectangle where I hoped to see the map. 

Try it without the vector branch? I was pretty sure that at some point,
someone was successfully printing without vector stuff, and I wouldn't
be surprised to find out that the vector SVG layer obscures the map. 

However, you are probably better off implementing a server-side PDF
generation tool using your map server, and fetching the map extents from
OpenLayers using Javascript. http://mumbai.freemap.in/ has a 'PDF of
this area' link, which works by updating the URL every time the map is 
dragged, and then using MapServer on the server side to generate the
PDF (simply using a different outputformat), which is probably the best
way to get a decent map out, rather than depending on browser
functionality.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list