Read all four MediaBox elements explicitly to calculate page dimensions, rather than assuming a value of zero for the first two elements.
Add tests for both portrait and landscape pages, with and without rotation