Document document;
Font f;
Rectangle pagesize = (Rectangle)getValue("pagesize");
if ("LANDSCAPE".equals(getValue("orientation"))) {
f = FontFactory.getFont(FontFactory.COURIER, 10);
document = new Document(pagesize.rotate(), 36, 9, 36, 36);
}
else {
f = FontFactory.getFont(FontFactory.COURIER, 11);
document = new Document(pagesize, 72, 36, 36, 36);
}