4,152 questions
Opening pdf file from url
-- --
957
Reputation points
Hi
I am using this code to open a pdf file from a url;
var DocPath = "http://mydomain.com/Docs/MyDoc.PDF";
Launcher.TryOpenAsync(new System.Uri(DocPath));
However I am getting the 'Cannot display PDF (MyDoc.PDF cannot be opened)' error.
Tried below code as well with no luck.
Uri uri=new Uri(DocPath);
await Browser.Default.OpenAsync(uri,BrowserLaunchMode.SystemPreferred);
What is the issue? Are there any special permission required in MAUI to open urls/pdf?
If I enter url [http://mydomain.com/Docs/MyDoc.PDF] in a desktop browser the pdf opens fine.
Thanks
Regards
Developer technologies .NET .NET MAUI
Sign in to answer