ECMS-5819: CLONE - Error showing PDF file in a linked detail page

Fix description:
  - Separate redundant code into a public function of Utils