1

I have a winforms application in which i need to show a pdf (which is in a public remote url) in the default internet web browser of the user's computer once user clicks on an about option in a menu.

The remote url for the pdf is something like below:

https://path/to/the/pdf/file/myfile.pdf

I have googled a lot and see tons of examples using WebClient (synchronous and asynchronous) and also HttpClient seems it looks like WebClient is already obsolete.

So I have found below ones:

and also other examples, but in this case for asp.net, not for winforms:

I am interested in showing the remote pdf file directly in the user default internet web browser inline without needing to download the pdf file before. So is it possible? and if so, how?

In the last two link that I have provided about asp.net (not winforms), i see that it is possible by setting the inline property to true for the Content-Disposition header in the response, but of course, it is for asp.net, not for winforms, so I don't know how I can do the same in my case using winforms.

I want to avoid download the pdf file. In all the winforms examples I find (see links provided above) it always says to download the pdf file first in the local computer and then show it. I am not able to find how to show it inline without downloading it.

Note: I am using .NET 4.5

Kiraski
  • 27
  • 5
  • You open an URL pointing to a PDF using the default browser the same way as you open any other URL... – Doc Brown Feb 02 '23 at 13:53
  • Does this answer your question? [How to open in default browser in C#](https://stackoverflow.com/questions/4580263/how-to-open-in-default-browser-in-c-sharp) – Doc Brown Feb 02 '23 at 13:53
  • ... note if the browser has to download the full PDF before it can show the first pages depends on the format of the PDF file and the specific browser. – Doc Brown Feb 02 '23 at 13:54
  • 1
    @KJ: thanks for sharing that link, I guess it might help to damp the OP's expectations ;-) – Doc Brown Feb 02 '23 at 20:08
  • Finally I did a Process.Start(remote_url) – Kiraski Feb 03 '23 at 20:53

0 Answers0