     required public init?(coder aDecoder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }
-    
+
     deinit {
         NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillShow, object: nil)
         NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillHide, object: nil)
-        
+
         self.removeObserver(self, forKeyPath: "frame")
     }
-    
+
     override open func layoutSubviews() {
         super.layoutSubviews()
-        
+
         let boundsSize = bounds.size
         var viewFrame = containerView.frame
-        
+
         if viewFrame.size.width < boundsSize.width {
             viewFrame.origin.x = (boundsSize.width - viewFrame.size.width) / 2.0 + contentOffset.x
         } else {
             viewFrame.origin.x = 0.0
         }
-        
+
         if viewFrame.size.height < boundsSize.height {
             viewFrame.origin.y = (boundsSize.height - viewFrame.size.height) / 2.0 + contentOffset.y
         }

open class PDFPageContentView: UIScrollView, UIScrollViewDelegate {
    let contentView: PDFPageContent
    let containerView: UIView
    
    open var page: Int
    open var contentDelegate: PDFPageContentViewDelegate?
    open var viewDidZoom: ((CGFloat) -> Void)?
    fileprivate var PDFPageContentViewContext = 0
    fileprivate var previousScale: CGFloat = 1.0
    
    let bottomKeyboardPadding: CGFloat = 20.0
    
    init(frame: CGRect, document: PDFDocument, page: Int) {
        self.page = page
        contentView = PDFPageContent(document: document, page: page)
        
        containerView = UIView(frame: contentView.bounds)
        containerView.isUserInteractionEnabled = true
        containerView.contentMode = .redraw
        containerView.backgroundColor = UIColor.white
        containerView.autoresizesSubviews = true
        containerView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
        
        super.init(frame: frame)
        
        scrollsToTop = false
        delaysContentTouches = false
        showsVerticalScrollIndicator = false

            name: .UIKeyboardWillHide,
            object: nil
        )

        let singleTapRecognizer = UITapGestureRecognizer(
            target: self,
            action: #selector(PDFPageContentView.processSingleTap(_:))
