Move pdf url calculation to the view.