     private weak var pageViewDelegate: PDFPageViewDelegate?
     
     init(frame: CGRect, document: PDFDocument, pageNumber: Int, pageViewDelegate: PDFPageViewDelegate?) {
-        let backgroundImage = document.getPDFPageImage(pageNumber + 1)
+        let backgroundImage = document.getPDFPageImage(at: pageNumber + 1)
         guard let pageRef = document.coreDocument.page(at: pageNumber + 1) else { fatalError() }
         
         PDFPage = pageRef
         self.pageViewDelegate = pageViewDelegate
         
         // Determine the size of the PDF page.
-        var pageRect = PDFPage.getBoxRect(CGPDFBox.mediaBox)
+        var pageRect = PDFPage.getBoxRect(.mediaBox)
         PDFScale = min(frame.size.width/pageRect.size.width, frame.size.height/pageRect.size.height)
-        pageRect.size = CGSize(width: pageRect.size.width * PDFScale!, height: pageRect.size.height * PDFScale!)
+        pageRect.size = CGSize(width: pageRect.size.width * PDFScale, height: pageRect.size.height * PDFScale)
         
         guard !pageRect.isEmpty else { fatalError() }
         


internal final class PDFPageView: UIScrollView {
    /// The TiledPDFView that is currently front most.
    fileprivate var tiledPDFView: TiledView!
    
    fileprivate var PDFScale: CGFloat?
    
    private let ZOOM_LEVELS = 2
    private let ZOOM_STEP = 2

        // To handle the interaction between CATiledLayer and high resolution screens, set the 
        // tiling view's contentScaleFactor to 1.0. If this step were omitted, the content scale factor 
        // would be 2.0 on high resolution screens, which would cause the CATiledLayer to ask for tiles of the wrong scale.
        tiledPDFView.contentScaleFactor = 1
    }
    
    func handleSingleTap(_ tapRecognizer: UITapGestureRecognizer) {
