我正在为 phonegap 寻找一个好的 PDF 查看器(甚至可以是 $$),带有缩略图操作等。
到目前为止,我使用的是缺少功能的 childbrowser 插件。
有人知道一些插件/工具包/示例吗?
谢谢
我正在为 phonegap 寻找一个好的 PDF 查看器(甚至可以是 $$),带有缩略图操作等。
到目前为止,我使用的是缺少功能的 childbrowser 插件。
有人知道一些插件/工具包/示例吗?
谢谢
我找到了两个选择:
n 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);
}