Creating and adding a vector feature to a layer:
var points = [
new OpenLayers.Geometry.Point(0, 0),
new OpenLayers.Geometry.Point(0, 100),
new OpenLayers.Geometry.Point(100, 100),
new OpenLayers.Geometry.Point(100, 0)
];
var ring = new OpenLayers.Geometry.LinearRing(points);
var polygon = new OpenLayers.Geometry.Polygon([ring]);
// create some attributes for the feature
var attributes = {name: "my name", bar: "foo"};
var feature = new OpenLayers.Feature.Vector(polygon, attributes);
var layer = new OpenLayers.Layer.Vector("Test");
layer.addFeatures([feature]);
However you may prefer to look at the GeoExt print controls as they support page sizes such as A4 and add preview areas to the map. You can also look at the sourcecode to see how they do this.