Question: I'm trying to display a pdf on an iOS device (ipad) using PDFkit. For some reason, swift displays the second page when the display opens. I figure out part of the problem is the preview.autoscale. When I set this to false, the pdf is not full screen, but it starts on the first page. So, I think the issue is the "zoom" part of the autoscale is zooming in on the first page. I did find a simalar question on stackoverflow ([PDFKit: PDFView doesn't resize when device rotated](https://stackoverflow.com/questions/50647315/pdfkit-pdfview-doesnt-resize-when-device-rotated)), but the soution didnt work. Below is the relevant code:

```
    if let FBdocument = PDFDocument(url: fileURL) {
        pdfView.document = FBdocument
        pdfView.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(pdfView)

        pdfView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor,constant: 0.0).isActive = true
        pdfView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor,constant: 0.0).isActive = true
        pdfView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor,constant: 0.0).isActive = true

        pdfView.bottomAnchor.constraint(equalTo: letdothis_button.topAnchor,constant: 0.0).isActive = true

        pdfView.autoScales = true

```

Answer: 
I was having issues with autoscales too, I found that moving: 

```
pdfView.autoScales = true

```

Along with any other positioning methods to before:

```
pdfView.document = FBdocument

```

And then to add the subview last:

```
 view.addSubview(pdfView)

```

Thus I would use:

```
if let FBdocument = PDFDocument(url: fileURL) {

    pdfView.translatesAutoresizingMaskIntoConstraints = false

    pdfView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor,constant: 0.0).isActive = true
    pdfView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor,constant: 0.0).isActive = true
    pdfView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor,constant: 0.0).isActive = true

    pdfView.bottomAnchor.constraint(equalTo: letdothis_button.topAnchor,constant: 0.0).isActive = true

    pdfView.autoScales = true

    pdfView.document = FBdocument

    view.addSubview(pdfView)

```
This is a bug on iPad Only (working fine with iPhone), I did send a Bug Report
and they responded it's duplicate of another report
that mean they knew about it and hopefully, they will fix it soon