         if pdfView.displayDirection == .vertical {
             let frame = view.frame
             let aspectRatio = frame.size.width / frame.size.height
-            var scaleFactor = pdfView.scaleFactorForSizeToFit
+            // if it is iPhoneX, the pdfView.scaleFactorForSizeToFit is already optimized for save area
+            let divider = (pdfView.frame.width - pdfView.safeAreaInsets.left - pdfView.safeAreaInsets.right) / pdfView.frame.width
+            // the scaleFactor defines the super area scale factor
+            var scaleFactor = pdfView.scaleFactorForSizeToFit / divider
             if pdfView.displayMode == .twoUpContinuous {
                 scaleFactor *= 2
             }

    
    func setScaleFactorForUser() {
        var scaleFactor: ScaleFactor?
        if pdfView.displayDirection == .vertical {
            scaleFactor = scaleFactorVertical
        } else if pdfView.displayDirection == .horizontal {

                    pdfView.scaleFactor = scaleFactor.portrait / 2
                }
            } else if UIApplication.shared.statusBarOrientation.isLandscape {
                if pdfView.displayMode == .singlePageContinuous {
                    pdfView.scaleFactor = scaleFactor.landscape
                } else if pdfView.displayMode == .twoUpContinuous {
                    pdfView.scaleFactor = scaleFactor.landscape / 2
                }
            }
        }
