Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How can I open a local PDF on Xamarin Forms?

$
0
0

Lets say I saved a PDF file to my local project. How can I have a button in Xamarin Forms open the PDF in the devices default viewer? How would I be able to open it in a web browser?

  • I tried opening it in URI with the file path, but that doesn't seem to work.
  • I dont want to make a custom PDF webview, I just want it to open in some default viewer or browser if possible.
  • Opening the pdf file path in Android PrintDocumentAdapter pda = new CustomPrintDocumentAdapter(filePath); seems to work, but this is some print preview view
  • Opening it in UWP with Windows.System.Launcher.LaunchFileAsync(file); seems to work great. Why doesn't Android and iOS have something like this?

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>