我使用此代码在webview中呈现pdf:
webView.Settings.JavaScriptEnabled = true;
webView.Settings.AllowFileAccess = true;
webView.Settings.AllowUniversalAccessFromFileURLs=true;
webView.Settings.LoadWithOverviewMode = true;
webView.Settings.UseWideViewPort = true;
webView.SetWebViewClient(new PDFWebViewClient());
string pdf = "http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf";
webView.LoadUrl ("http://docs.google.com/viewer?embedded=true&url="+pdf);
webView.Invalidate ();
问题是pdf被切断并且没有填满webView的宽度。 滚动也非常滞后
webviewclient(内部类):
class PDFWebViewClient : WebViewClient
{
public override bool ShouldOverrideUrlLoading (WebView view, string url)
{
view.LoadUrl(url);
return true;
}
}
应用程序输出/控制台在滚动时显示:
[webclipboard] clipservice: android.sec.clipboard.ClipboardExManager@41bf5db8
WIDTHSCALE 1.25
[WML_SISO] InitPasteboardJni
[SlidingMenu] setting padding
[CustomViewBehind] behind INVISIBLE
[OpenGLRenderer] Flushing caches (mode 0)
[GATE] <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
[skia] xxxxxxxxxxxxxxxxxx clip not implemented
[skia] xxxxxxxxxxxxxxxxxx clip not implemented
[skia] xxxxxxxxxxxxxxxxxx clip not implemented
[skia] xxxxxxxxxxxxxxxxxx clip not implemented