This example shows the how to use GeoExt.PrintMapPanel, to create a printable OSM map. It requires the MapFish or GeoServer print module.
The js is not minified so it is readable. See print-preview-osm.js.