如何使用MuPDF保存密码保护的PDF注释 [英] How to save annotation on password protected pdf using MuPDF

查看:1881
本文介绍了如何使用MuPDF保存密码保护的PDF注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想保存密码保护的PDF注释。我能画批注并保存。但只要我在活动回去再来我看不到我的注释。然而奇怪的是,我可以看到注释框有,但不是绘制路径。它正常工作与正常的PDF(无密码PDF)。任何想法我怎么能保存密码保护的PDF批注?

下面是code我使用的:

 私人MuPDFCore核心;
私人MuPDFReaderView mDocView;
/ **
     *节省的修改到PDF。例如。画
     * /
    私人无效savePDFChanges(){
        Config.error(保存修改+ core.hasChanges());
        如果(core.hasChanges()){
            core.save();
        }
    }    / **
     *切换上的PDF绘图模式。
     * /
    私人无效setDrawingMode(){
        mDocView.setMode(MuPDFReaderView.Mode.Drawing);
    }    / **
     *上的PDF切换浏览模式。
     * /
    私人无效setViewMode(){
        mDocView.setMode(MuPDFReaderView.Mode.Viewing);
    }
isDrawSaved = pageView.saveDraw();

我在下面的顺序调用函数。

  1)setDrawingMode();
2)pageView.saveDraw();
3)setViewMode();
4)savePDFChanges();


解决方案

我不知道有一种不同的方法来保存密码保护的文件标注的事情。保存PDF一旦注释被添加。同时检查与Alpha的颜色code您正在使用。

I am trying to save annotation for password protected pdf. I am able to draw annotation and save it. But as soon as I go back and come again in activity I cannot see my annotation. However strange thing is I can see annotation box there but not the drawn path. It works fine with normal pdf(without password pdf). Any idea how can I save annotation for password protected pdf?

Below is the code I am using :

private MuPDFCore core;
private MuPDFReaderView mDocView;
/**
     * Save's changes to the pdf. Eg. Draw
     */
    private void savePDFChanges(){
        Config.error("Saved changes "+core.hasChanges());
        if(core.hasChanges()){
            core.save();
        }
    }

    /**
     * Toggles Drawing mode on Pdf.
     */
    private void setDrawingMode(){
        mDocView.setMode(MuPDFReaderView.Mode.Drawing);
    }

    /**
     * Toggles View mode on Pdf.
     */
    private void setViewMode(){
        mDocView.setMode(MuPDFReaderView.Mode.Viewing);
    }
isDrawSaved=pageView.saveDraw();

I am calling function in following sequence.

1)setDrawingMode();
2)pageView.saveDraw();
3)setViewMode();
4)savePDFChanges();

解决方案

I don't thing there is a different approach to save annotation for password protected file. Save the PDF once the annotation is added. Also check the colour code with alpha that you are using.

这篇关于如何使用MuPDF保存密码保护的PDF注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆