Set document resolution before begindoc. Fix page sizes.