I'm using PDFKit to display pdf using pdfview to user and it works perfectly. here is my implementation of pdfview. and here are the properties of pdfview.
if let pdfdoc = PDFDocument(url: docurl) {
print("working")
pdfdocument = pdfdoc
pdfview.document = pdfdocument
pdfview.autoScales = false
pdfview.delegate = self
pdfview.displayMode = .singlePageContinuous
}
now what I want is to get exact origin of the current page. but it gives always (0,1) for each and every page. this is how I tried.
let currentpage = pdfview.currentPage
print(currentpage?.bounds(for: .mediaBox).origin.x)
the X
value is always 0
.
I have attached a screenshot which I want to get the x and y value of the page.
How can I get this x and y value of the pdf page. hope your help with this.
I'm using the following: