Also, this chunk is very long as you have functions defined in there. Can you move the functions like `pageHeight(...)`, `pageOffsetTop(...)` and `goToBottomOfPage(...)` onto the `PDFViewer` object directly?