Peace be upon you,
Here is a clean way for adding the PDF icon to be recognized by SharePoint document library and also by search results:
The post is also having links to information about how to index the contents of a PDF file with SharePoint search.
Also, you can understand from here how SharePoint is handling the file icons in general:
In case you wanted to get Icon URL for a file, here is comparison between SPUtility.MapToIcon and SPFile.IconUrl: