@YukiS888 I hope you are using Open URL in window action to download PDF in a new pop up . You can use the same action . Just make sure that Use Page check box is checked and In the Window Name provide value "_self".
I think you need to customize the Link Control action in pyCaseRelatedContentItem to download the attached file directly by using activity. Please refer the attached file for how to write an activity to download file.