私はxamarin.formsで働いています。 josnレスポンスとしてHTMLコンテンツを取得しました。webview xamarin.formsでリモートパスpdfを開く方法
<!-- THEME DEBUG --> <!-- CALL: theme('node') --> <!-- FILE NAME SUGGESTIONS: * node--253.tpl.php * node--article.tpl.php x node.tpl.php -->
<!-- BEGIN OUTPUT from 'sites/all/themes/maharastracmonew/templates/node.tpl.php' -->
<div id="node-253" class="node node-article clearfix" about="/maharastracmo/en/magazines" typeof="sioc:Item foaf:Document">
<h2> <a href="/maharastracmo/en/magazines">Magazine Gallery</a> </h2>
<span property="dc:title" content="Magazine Gallery" class="rdf-meta element-hidden"></span>
<span property="sioc:num_replies" content="0" datatype="xsd:integer" class="rdf-meta element-hidden"></span>
<div class="field field-name-body field-type-text-with-summary field-label-hidden">
<div class="field-items">
<div class="field-item even" property="content:encoded">
<div class="innerContent">
<div class="pdfBlock">
<div class="pdfIconBox">
<a href="http://14.141.36.212/maharastracmo/sites/all/themes/maharastracmonew/pdf/MA-June15-binder-6.pdf" target="_blank">
<img alt="" src="http://14.141.36.212/maharastracmo/sites/all/themes/maharastracmonew/images/book-icon.png" />
</a>
<h5>Maharashtra Ahead</h5> <span class="bookDate">June 2015</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- END OUTPUT from 'sites/all/themes/maharastracmonew/templates/node.tpl.php' -->
はこのコンテンツでは、1枚の画像と画像.PDF上のユーザーのクリックは新しいブラウザで開いているときにそこにあります。
私はhtmlを作成し、そのHTMLをWebViewに表示しますが、画像をクリックするとpdfファイルは開かれません。 pdfファイルはリモートデバイスからのものです。 (サーバ)。
2回目の試行:私はWebViewのを取られ、ソースプロパティが、空白のページが開いていると、単純にPDFファイルのリモートパスを入れている第二の選択肢として
。どうすればこの問題を解決できますか?
3回目:
私は単純に一つのボタンを使用し、ボタンをクリックしてイベントPDFファイルのパスが別のブラウザで開いています。 pdfファイルを直接ダウンロードする代わりに開くことはありません。
protected async void OnClicked(object sender, EventArgs e)
{
var uri = new Uri("http://14.141.36.212/maharastracmo/sites/all/themes/maharastracmonew/pdf/MA-June15-binder-6.pdf");
Device.OpenUri(uri);
}
は、デフォルトでは非HTTPSの参照をブロックするような場所に置かれています。出力ウィンドウでネットワークエラーを調べます。これらの制限から特定のURLを除外する方法については、[こちら](https://developer.xamarin.com/guides/ios/platform_features/introduction_to_ios9/ats/#Opting-Out_of_ATS)をご覧ください。 Androidでは、WebViewsはデフォルトでPDFを開くことができません。それらを表示するには、まずそれらをダウンロードする必要があります。 – hvaughan3
どのプラットフォームでこの問題が発生していますか? Androidで? Androidの 'WebView'は、それをそのままの形でサポートしていません。あなたは 'loadUrl'を必要とします。これは依存関係サービスなどでしか得られません。 – testing