Documentviewer fixes

This PR incorporates

- #3349: Document preview error when jumping to end of document
- #3351: Document preview jumps to wrong page
- #3352: Document preview inappropriately submits form on single page document