The icons are selected based on the mime-type name. The basic idea is that there should be an icon named application-pdf.png
or similar in the path for the current theme.
For example, in my system there are a bunch of them, you can find them by
locate application-pdf | grep icons
Moreover, you can find the files for definition of characteristics of mime-types in /usr/share/mime/
: for example for application-pdf you have /usr/share/mime/application/pdf.xml
. I do not know if this file can contain an override for the icon.
I have published a little page for adding new MIME types, but I am not sure if publishing the link here is considered acceptable policy...