title: Swift PDFKit: Unable to scale view to a small size
body: <p>I am attempting to display a pdf document on a pdfView and would like it to scale such that I can see the full content view within the bounds of the device. However, I am unable to scale it small enough to do so. I have attempted some solutions on SO but still doesn't work.</p>
  
  <p>My implementation so far:</p>
  
  <pre><code>let pdfView: PDFView = {
    let v = PDFView()
    v.translatesAutoresizingMaskIntoConstraints = false
    return v
  }()
  
  override func viewDidLoad() {
    super.viewDidLoad()
  
    //addSubview and autolayout constraints to superview
  
    if let url = Bundle.main.url(forResource: "documentName", withExtension: "pdf"), let document = PDFDocument(url: url) {
      pdfView.document = document
  
      guard let page = document.page(at: 0) else {return}
      let pageSize = page.bounds(for: .cropBox)
      let screenSize = UIScreen.main.bounds
      let scale = screenSize.width / pageSize.width
      pdfView.scaleFactor = scale
    }
  }
  </code></pre>
  
  <p>Note that these are things I have tried but doesn't work:</p>
  
  <pre><code>pdfView.autoScales = true
  pdfView.displayMode = .singlePage
  pdfView.minScaleFactor = // to a very small value
  </code></pre>
  
  <p>I also attempted to iterate the scaleFactor manually by setting 0.01 but realised that the view will not scale lower than 0.25. Is there a way for me to scale even lower? The order of scaling in my appliction is in the order of 0.1-0.2. Thanks.</p>