I have a Help function in my Application , which consists of one webbrowser control . That the webbrowser control populated with a .pdf file , the source for this .pdf file is our own website.
The problem is that everyone will not have PDF Reader installed on their machine, so I want to check if it is installed: Yes or No. I searched on the Internet, and I basically saw that users on Stackoverflow, where they want to check if Adobe Reader installed, is not what I want. I need to know if PDF PDF Reader installed on the machine.
I found the following code that might help me:
public void CheckPdfReaderAvailable() { RegistryKey key = Registry.ClassesRoot.OpenSubKey(".pdf"); Assert.IsNotNull(key); }
As I see the above code, my thoughts are that the code checks to see if the registry .pdf format knows, but I'm not sure.
Can someone tell me how to use the code above or provide me with an example on how I should fix this problem?
Thanks in advance!
EDIT:
The following answer helped me: stack overflow
Another way to solve this problem is to add the PDF reader lite to the prerequisites and first install the users, you do not need to check the PDF reader, because you know that it is installed, unless you could say that the user’s error was that they cannot use the help function because you offered them an easy way to install a PDF reader using a published project.
source share