This example shows the how to create a printable PDF with GeoExt.data.PrintProvider and GeoExt.data.PrintPage, using the MapFish or GeoServer print module.
The js is not minified so it is readable. See print-page.js.