1

I am working on PDFKit and try to rotate the page. It is rotating good but without using usePageViewController. With usePageViewController it won't update the frame of the page.

// At defining PDFVIEW object
pdfView.displayMode = .singlePageContinuous
pdfView.usePageViewController(true, withViewOptions: nil)
// For rotating screen
pdfView.currentPage?.rotation += 90

without usePageViewController pagination is not working. How to achieve both at same place.

https://i.stack.imgur.com/xifjV.jpg

https://i.stack.imgur.com/HUogU.jpg

Spanix Dev
  • 101
  • 6

1 Answers1

1

You can do a trick, it works for me :). Before changing the rotation set

    usePageViewController(false) 

and after that

    usePageViewController(true)
guard let currentPage = self.pdfView.currentPage else {return}
self.pdfView.usePageViewController(false)
self.angle = self.angle + 90
currentPage.rotation = self.angle
self.pdfView.usePageViewController(true)
self.pdfView.autoScales = true
self.pdfView.go(to: currentPage)
Shehryar Khan
  • 71
  • 1
  • 4