Hey, Thanks for your help.
No I’m not displaying any pdf on frontend. I just want to display an icon of download if the pdf is being attached with the post.
To attach the pdf with the post I’ve used the file type field of ACF plugin. So I just need if the file is attached with any of the post than that post will show the download icon on front-end, if not contains any pdf than the icon will be hidden. So that when user clicks on the download icon it will be download the attach pdf and this is the default functionality of attaching any file. and it is working too. I just want to know how to hide/show download icon on the posts with or without any pdf being attched with the any post.