Post not yet marked as solved
Post marked as unsolved with 2 replies, 1,020 views
I took pdfView, and I am trying to load pdf document on this pdfView. Pdf is not displaying/showing full screen w.r.t its pdfView as I added in storyboard. It has some gaps from top and bottom.
Here is the code, I wrote
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)