2

我知道有很多图书馆不适合像 mupdf 这样的商业用途。我的公司是一家初创公司,没有能力花很多钱。我正在开发一个杂志应用程序。任何人都可以推荐一个好的开源库用于渲染单个 pdf,或者如果不可能的话,我应该更喜欢付费的哪一个?提前致谢

4

1 回答 1

0

您可以将 webview 与 google 文档一起使用。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<WebView
android:id="@+id/wv"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/> 

 WebView wv= (WebView) findViewById(R.id.wv);
 wv.setVerticalScrollBarEnabled(true);
 wv.setHorizontalScrollBarEnabled(true);
 wv.getSettings().setBuiltInZoomControls(true);
 wv.getSettings().setJavaScriptEnabled(true);
 wv.setWebViewClient(new WebViewClient());
 wv.loadUrl("https://docs.google.com/file/d/0B8ZDVNCvRWK8c3YzQVFaWjg1bEU/edit")//pdf uploaded to google docs. Some cases requires users to login and requires permission of the owner of the doc.

您可以使用意图。您的手机必须有 pdf 阅读器应用程序。

  File file = new File("/sdcard/example.pdf");
            if (file.exists()) {
                Uri path = Uri.fromFile(file);
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setDataAndType(path, "application/pdf");
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

                try {
                    startActivity(intent);
                } 
                catch (ActivityNotFoundException e) {
                    Toast.makeText(OpenPdf.this, 
                        "No Application Available to View PDF", 
                        Toast.LENGTH_SHORT).show();
                }

http://code.google.com/p/apv/source/checkout。APV PDF 查看器

http://code.google.com/p/apdfviewer/。APDF 查看器。

于 2013-03-21T06:34:22.570 回答