Refactored more code in RenderPDFViewController.