Check if PDF viewer plugin is installed in IE/Chrome/FireFox/Safari












-3















I am trying to create function that will essentially check if there is any PDF Viewer [Adobe or any other] is installed as Plugin for browser.



For example:
I someone click on link in webpage it will open up the PDF file instead of showing option to download, this means a PDF viewer plugin is present in browser.



I have my help on internet for this but none of them is with C# code.




  • Most of them is either JavaScript to check the plugins

  • others are there to check if Adobe PDF viewer is installed on the machine.










share|improve this question

























  • Use the second approach and rewrite it in C#?

    – Lasse Vågsæther Karlsen
    Nov 21 '18 at 6:39











  • It is going to be a lot of work if you want to support every browser and every such plugin.

    – Lasse Vågsæther Karlsen
    Nov 21 '18 at 6:42











  • I have to check for 4 browser that is mentioned in the question.

    – AMIT SHELKE
    Nov 21 '18 at 6:50











  • I know that Chrome has built in, so just want to check from my C# code to see if it present. Likewise for other browser.

    – AMIT SHELKE
    Nov 21 '18 at 6:52











  • Isn't normal behaviour that the browser will show the PDF if it has a plugin, rather than downloading it? Are you doing this from a web application?

    – John
    Nov 21 '18 at 6:57


















-3















I am trying to create function that will essentially check if there is any PDF Viewer [Adobe or any other] is installed as Plugin for browser.



For example:
I someone click on link in webpage it will open up the PDF file instead of showing option to download, this means a PDF viewer plugin is present in browser.



I have my help on internet for this but none of them is with C# code.




  • Most of them is either JavaScript to check the plugins

  • others are there to check if Adobe PDF viewer is installed on the machine.










share|improve this question

























  • Use the second approach and rewrite it in C#?

    – Lasse Vågsæther Karlsen
    Nov 21 '18 at 6:39











  • It is going to be a lot of work if you want to support every browser and every such plugin.

    – Lasse Vågsæther Karlsen
    Nov 21 '18 at 6:42











  • I have to check for 4 browser that is mentioned in the question.

    – AMIT SHELKE
    Nov 21 '18 at 6:50











  • I know that Chrome has built in, so just want to check from my C# code to see if it present. Likewise for other browser.

    – AMIT SHELKE
    Nov 21 '18 at 6:52











  • Isn't normal behaviour that the browser will show the PDF if it has a plugin, rather than downloading it? Are you doing this from a web application?

    – John
    Nov 21 '18 at 6:57
















-3












-3








-3








I am trying to create function that will essentially check if there is any PDF Viewer [Adobe or any other] is installed as Plugin for browser.



For example:
I someone click on link in webpage it will open up the PDF file instead of showing option to download, this means a PDF viewer plugin is present in browser.



I have my help on internet for this but none of them is with C# code.




  • Most of them is either JavaScript to check the plugins

  • others are there to check if Adobe PDF viewer is installed on the machine.










share|improve this question
















I am trying to create function that will essentially check if there is any PDF Viewer [Adobe or any other] is installed as Plugin for browser.



For example:
I someone click on link in webpage it will open up the PDF file instead of showing option to download, this means a PDF viewer plugin is present in browser.



I have my help on internet for this but none of them is with C# code.




  • Most of them is either JavaScript to check the plugins

  • others are there to check if Adobe PDF viewer is installed on the machine.







c#






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 6:42









John

12.3k32140




12.3k32140










asked Nov 21 '18 at 6:37









AMIT SHELKEAMIT SHELKE

2073923




2073923













  • Use the second approach and rewrite it in C#?

    – Lasse Vågsæther Karlsen
    Nov 21 '18 at 6:39











  • It is going to be a lot of work if you want to support every browser and every such plugin.

    – Lasse Vågsæther Karlsen
    Nov 21 '18 at 6:42











  • I have to check for 4 browser that is mentioned in the question.

    – AMIT SHELKE
    Nov 21 '18 at 6:50











  • I know that Chrome has built in, so just want to check from my C# code to see if it present. Likewise for other browser.

    – AMIT SHELKE
    Nov 21 '18 at 6:52











  • Isn't normal behaviour that the browser will show the PDF if it has a plugin, rather than downloading it? Are you doing this from a web application?

    – John
    Nov 21 '18 at 6:57





















  • Use the second approach and rewrite it in C#?

    – Lasse Vågsæther Karlsen
    Nov 21 '18 at 6:39











  • It is going to be a lot of work if you want to support every browser and every such plugin.

    – Lasse Vågsæther Karlsen
    Nov 21 '18 at 6:42











  • I have to check for 4 browser that is mentioned in the question.

    – AMIT SHELKE
    Nov 21 '18 at 6:50











  • I know that Chrome has built in, so just want to check from my C# code to see if it present. Likewise for other browser.

    – AMIT SHELKE
    Nov 21 '18 at 6:52











  • Isn't normal behaviour that the browser will show the PDF if it has a plugin, rather than downloading it? Are you doing this from a web application?

    – John
    Nov 21 '18 at 6:57



















Use the second approach and rewrite it in C#?

– Lasse Vågsæther Karlsen
Nov 21 '18 at 6:39





Use the second approach and rewrite it in C#?

– Lasse Vågsæther Karlsen
Nov 21 '18 at 6:39













It is going to be a lot of work if you want to support every browser and every such plugin.

– Lasse Vågsæther Karlsen
Nov 21 '18 at 6:42





It is going to be a lot of work if you want to support every browser and every such plugin.

– Lasse Vågsæther Karlsen
Nov 21 '18 at 6:42













I have to check for 4 browser that is mentioned in the question.

– AMIT SHELKE
Nov 21 '18 at 6:50





I have to check for 4 browser that is mentioned in the question.

– AMIT SHELKE
Nov 21 '18 at 6:50













I know that Chrome has built in, so just want to check from my C# code to see if it present. Likewise for other browser.

– AMIT SHELKE
Nov 21 '18 at 6:52





I know that Chrome has built in, so just want to check from my C# code to see if it present. Likewise for other browser.

– AMIT SHELKE
Nov 21 '18 at 6:52













Isn't normal behaviour that the browser will show the PDF if it has a plugin, rather than downloading it? Are you doing this from a web application?

– John
Nov 21 '18 at 6:57







Isn't normal behaviour that the browser will show the PDF if it has a plugin, rather than downloading it? Are you doing this from a web application?

– John
Nov 21 '18 at 6:57














1 Answer
1






active

oldest

votes


















0














As a pure C# solution, I am not sure where you would want to run it, how would you go about using C# on a browser unless you are working server side? you can try the below as soon as you load your browser page and just save the details to the session variable if asp.net, then you always have a reference to the status of weather the plugin is installed or not.



You cant try a few ways to solve the issue, the first and simplest would be to just create a simple object tag



<object width="400" height="400" data="helloworld.pdf">
<p>Browser does not support PDF</p>
</object>


You can render this on a different page and just query if the control comes up or if the Browser does not support PDF message is shown,might as well just hide it, render it and then check it.



Or you could use the NavigatorPlugins that you can go through and find if there is anything related to PDF



You can check a reference to this SO answer






share|improve this answer
























  • As I said earlier, I just want to use C# to check whether the plugin exist or not. In other word, does it have some information in some file/registry etc.

    – AMIT SHELKE
    Nov 21 '18 at 7:26











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406474%2fcheck-if-pdf-viewer-plugin-is-installed-in-ie-chrome-firefox-safari%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














As a pure C# solution, I am not sure where you would want to run it, how would you go about using C# on a browser unless you are working server side? you can try the below as soon as you load your browser page and just save the details to the session variable if asp.net, then you always have a reference to the status of weather the plugin is installed or not.



You cant try a few ways to solve the issue, the first and simplest would be to just create a simple object tag



<object width="400" height="400" data="helloworld.pdf">
<p>Browser does not support PDF</p>
</object>


You can render this on a different page and just query if the control comes up or if the Browser does not support PDF message is shown,might as well just hide it, render it and then check it.



Or you could use the NavigatorPlugins that you can go through and find if there is anything related to PDF



You can check a reference to this SO answer






share|improve this answer
























  • As I said earlier, I just want to use C# to check whether the plugin exist or not. In other word, does it have some information in some file/registry etc.

    – AMIT SHELKE
    Nov 21 '18 at 7:26
















0














As a pure C# solution, I am not sure where you would want to run it, how would you go about using C# on a browser unless you are working server side? you can try the below as soon as you load your browser page and just save the details to the session variable if asp.net, then you always have a reference to the status of weather the plugin is installed or not.



You cant try a few ways to solve the issue, the first and simplest would be to just create a simple object tag



<object width="400" height="400" data="helloworld.pdf">
<p>Browser does not support PDF</p>
</object>


You can render this on a different page and just query if the control comes up or if the Browser does not support PDF message is shown,might as well just hide it, render it and then check it.



Or you could use the NavigatorPlugins that you can go through and find if there is anything related to PDF



You can check a reference to this SO answer






share|improve this answer
























  • As I said earlier, I just want to use C# to check whether the plugin exist or not. In other word, does it have some information in some file/registry etc.

    – AMIT SHELKE
    Nov 21 '18 at 7:26














0












0








0







As a pure C# solution, I am not sure where you would want to run it, how would you go about using C# on a browser unless you are working server side? you can try the below as soon as you load your browser page and just save the details to the session variable if asp.net, then you always have a reference to the status of weather the plugin is installed or not.



You cant try a few ways to solve the issue, the first and simplest would be to just create a simple object tag



<object width="400" height="400" data="helloworld.pdf">
<p>Browser does not support PDF</p>
</object>


You can render this on a different page and just query if the control comes up or if the Browser does not support PDF message is shown,might as well just hide it, render it and then check it.



Or you could use the NavigatorPlugins that you can go through and find if there is anything related to PDF



You can check a reference to this SO answer






share|improve this answer













As a pure C# solution, I am not sure where you would want to run it, how would you go about using C# on a browser unless you are working server side? you can try the below as soon as you load your browser page and just save the details to the session variable if asp.net, then you always have a reference to the status of weather the plugin is installed or not.



You cant try a few ways to solve the issue, the first and simplest would be to just create a simple object tag



<object width="400" height="400" data="helloworld.pdf">
<p>Browser does not support PDF</p>
</object>


You can render this on a different page and just query if the control comes up or if the Browser does not support PDF message is shown,might as well just hide it, render it and then check it.



Or you could use the NavigatorPlugins that you can go through and find if there is anything related to PDF



You can check a reference to this SO answer







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '18 at 6:56









mahlatsemahlatse

987518




987518













  • As I said earlier, I just want to use C# to check whether the plugin exist or not. In other word, does it have some information in some file/registry etc.

    – AMIT SHELKE
    Nov 21 '18 at 7:26



















  • As I said earlier, I just want to use C# to check whether the plugin exist or not. In other word, does it have some information in some file/registry etc.

    – AMIT SHELKE
    Nov 21 '18 at 7:26

















As I said earlier, I just want to use C# to check whether the plugin exist or not. In other word, does it have some information in some file/registry etc.

– AMIT SHELKE
Nov 21 '18 at 7:26





As I said earlier, I just want to use C# to check whether the plugin exist or not. In other word, does it have some information in some file/registry etc.

– AMIT SHELKE
Nov 21 '18 at 7:26


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406474%2fcheck-if-pdf-viewer-plugin-is-installed-in-ie-chrome-firefox-safari%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

Npm cannot find a required file even through it is in the searched directory