Here is the code, I wrote
Code Block swift if let path = Bundle.main.path(forResource: "file-sample_150kB", ofType: "pdf") { if let pdfDocument = PDFDocument(url: URL(fileURLWithPath: path)) { pdfView.autoresizesSubviews = true pdfView.autoresizingMask = [.flexibleWidth, .flexibleHeight, .flexibleTopMargin, .flexibleLeftMargin] pdfView.displayDirection = .vertical pdfView.autoScales = true pdfView.displayMode = .singlePage pdfView.displaysPageBreaks = true pdfView.document = pdfDocument pdfView.maxScaleFactor = 4.0 pdfView.minScaleFactor = pdfView.scaleFactorForSizeToFit pdfView.usePageViewController(true, withViewOptions: [:]) } }
How I can remove that extra space from top and bottom and make/show/display that pdf document to full to screen w.r.t pdfView which I added in storyboard that same size.
Any solution for this?
Note - In my code/requirement displaying single page is needed
i.e pdfView.displayMode = .singlePage
Here is project link - [https://github.com/MallikarjunH/TestPDFFullScreen1)