This example shows the how to set the bounds of a printable PDF interactively with a dynamic print extent rectangle. It requires the MapFish or GeoServer print module.
Drag one of the handles to control the scale. Grab one of the corner handles at its edge to rotate the extent. Hold the SHIFT key to rotate in 45° increments only. Drag the extent rectangle to change the center.
The js is not minified so it is readable. See print-extent.js.