Removing some of unused pdf code and replacing it with the ability to set the viewport when capturing screenshot.