I’m trying to set my PDF to show on the WinRT device with zoom set to a certain percentage using the SetZoom() method. I can get it to work on the first page when the PDF first gets loaded, but when I swipe left to go to the next page, my zoom gets cleared and the second page shows the entire page instead of retaining my zoom.
I tried to fix this by tapping into the OnPageNumberChanged event and use the SetZoom() method again on each page change. But when I do this, I noticed that the OnPageNumberChanged event will result in an infinite loop. Here is my OnPageNumberChanged method:
void mPDFView_OnPageNumberChanged(int __param0, int __param1)
The variable “zoom” is pre-calculated when the PDF gets loaded into the viewer and when I put a breakpoint at the beginning of this event handler, I will experience the infinite loop as soon as I swipe left on a PDF. The problem seems to be related to the SetZoom() method because if I comment that line out (so I ended up with only the SetPageViewMode() method), I do not get the infinite loop.