Correctly handle landscape-oriented pages in PDFs