I have had recent questions about how to do file extensions when they are said by themselves without the full file name.
First, I would say that they should be done consistently.
Though I do not know that there is a "rule," I would recommend that they be transcribed as they look in the file name.
...It was a .jpg file...
...I received it as a .pdf...
Happy punctuating!
Margie