在Android中,您可以使用Android Intents查看pdf。这会向您显示手机中可用的所有pdf查看器。您可以选择任何和查看PDF
如:
private void showPdfAndroid(String url) throws IOException {
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = new File(url);
String extension = url.substring(url.lastIndexOf(".")+1);
String type = "";
if (extension.toLowerCase().equals("pdf")) {
type = "application/pdf";
Log.d("application/pdf", "application/pdf");
}
intent.setDataAndType(Uri.fromFile(file), type);
cordova.getActivity().startActivity(intent);
Log.d("FileViewerPlugin", "View complete in" + url);
}
看看这个链接http://stackoverflow.com/questions/6979344/embed-pdf-viewer-for-phonegap-application – BBdev 2012-08-17 09:50:16
谢谢,但我认为它不是很有用,因为他们只是有一个IOS的解决方案 – 2012-08-17 09:52:58
你检查了这个博客http://www.giovesoft.com/2011/08/download-and-open-pdf-with-phonegap.html – BBdev 2012-08-17 10:20:07