I’m using v8.1.2 of the iOS SDK and looking for help with what I think is a zoom issue.
TLDR: When closing a document and opening a new document using the same controller, what is the magic incantation to make the new document “fit just right” in the controller?
I am inheriting from PTDocumentController, and I am reusing that view controller for any doc that I want to view. i.e.
- When a user first taps on a doc thumbnail in my UI, I create a PTDocumentController and use that to open and display the full doc. Looks amazing; the document is displayed at exactly the right zoom level and I didn’t even do anything to make that happen.
- When the user “exits” the PTDocumentController, I close the document but I keep the controller “alive” so that I can reuse it…
- When the user taps on a second thumbnail, I reuse that controller and simply call openDocument with the new document.
And that’s when I run into trouble. It’s almost like the controller has decided what zoom level it wants to use for that first document, and then it keeps that zoom level for the second document.
I’ve tried tinkering with “pdfViewCtrl.zoom” and “pdfViewCtrl.setZoomX” with various degrees of interesting results, but I’m clearly doing something wrong.
As always, thank you for the amazing help you give.