如何为PDF文件实现翻页效果

6

你好,我是一个新手,正在学习Android页面翻页应用。我使用Mupdf开源软件来展示PDF文件,通过intent action view实现。但是当前只能滚动查看,我希望能够实现页面翻页效果。如果有人知道答案,请分享一下,谢谢。

@Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        mAlertBuilder = new AlertDialog.Builder(this);

        if (core == null) {
            core = (MuPDFCore)getLastNonConfigurationInstance();

            if (savedInstanceState != null && savedInstanceState.containsKey("FileName")) {
                mFileName = savedInstanceState.getString("FileName");
            }
        }
        if (core == null) {
            Intent intent = getIntent();
            if (Intent.ACTION_VIEW.equals(intent.getAction())) {
                Uri uri = intent.getData();
                if (uri.toString().startsWith("content://media/external/file")) {
                    // Handle view requests from the Transformer Prime's file manager
                    // Hopefully other file managers will use this same scheme, if not
                    // using explicit paths.
                    Cursor cursor = getContentResolver().query(uri, new String[]{"_data"}, null, null, null);
                    if (cursor.moveToFirst()) {
                        uri = Uri.parse(cursor.getString(0));
                    }
                }
                core = openFile(Uri.decode(uri.getEncodedPath()));
            }
            if (core != null && core.needsPassword()) {
                requestPassword(savedInstanceState);
                return;
            }
        }
        if (core == null)
        {
            AlertDialog alert = mAlertBuilder.create();
            alert.setTitle(R.string.open_failed);
            alert.setButton(AlertDialog.BUTTON_POSITIVE, "Dismiss",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            finish();
                        }
                    });
            alert.show();
            return;
        }

        createUI(savedInstanceState);
    }

我想在MuPDF中实现卷曲效果。你知道怎么做吗?谢谢。 - kyogs
@kyogs,你找到解决问题的方法了吗?如果有答案,请指导我。 - Passion
@kyogs 和上面的评论一样! - Dr.jacky
@Passion 你呢?你找到在mupdf中实现卷曲效果的解决方案了吗? - Dr.jacky
2个回答

2

这个https://github.com/harism/android_page_curl下载代码和网站对我非常有用,非常感谢。 - Sathish Kumar
1
@Sathish Kumar,Aerrow...提供的链接没有使用渲染的mupdf页面进行翻页,那么它是如何解决你的问题的,请指导我也一下。 - Passion
与上面的评论相同! - Dr.jacky

1

如何在muPFD中使用这个?没有人将这两个东西合并在一起吗?真的! - Dr.jacky

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接