1

我正在为 phonegap 寻找一个好的 PDF 查看器(甚至可以是 $$),带有缩略图操作等。

到目前为止,我使用的是缺少功能的 childbrowser 插件。

有人知道一些插件/工具包/示例吗?

谢谢

4

3 回答 3

0

我认为第二个不适合Phonegap。

一个有趣的替代方案是PDF.js项目demo

是一个支持 HTML5 的 Javascript 查看器。

于 2013-07-28T17:23:43.907 回答
0

我找到了两个选择:

于 2013-07-28T17:14:32.090 回答
0

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);


}
于 2013-08-15T08:48:25.510 回答