Xamarin.forms display PDF in webview not working

后端 未结 2 1907
粉色の甜心
粉色の甜心 2020-12-12 04:10

I download a pdf stream from my server. In my app I save the bytearray to a the local folder as pdf. But when I open it in the webview, it just shows a white page.

I

2条回答
  •  一向
    一向 (楼主)
    2020-12-12 04:37

    Following approach will allow you to view pdf in xamarin forms. If you are trying to open one from azure blob or you have valid URl.

    WebView webView = new WebView();
    var page = new ContentPage();
    webView.Source = "https://docs.google.com/viewer?url=http://yourpdfurl.pdf";
    page.Content = webView;
    Navigation.PushModalAsync(page);
    

提交回复
热议问题