如何将PDF嵌入HTML并在Web视图中显示?
实际上,我正在尝试着去做这个,但是Web视图并没有加载这个页面。
String base = Environment.getExternalStorageDirectory().getAbsolutePath().toString();
String pdfPath = base + "/Principal.pdf";
Log.e("real path =", ""+pdfPath);
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setAllowFileAccess(true);
web.getSettings().setBuiltInZoomControls(true);
web.loadDataWithBaseURL("",
"<embed src='"+pdfPath+"' width='500' height='375'>",
"application/pdf",
"utf-8",
"");