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

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

问题描述

我正在尝试为受密码保护的 pdf 保存注释.我能够绘制注释并保存它.但是,一旦我回去再次参加活动,我就看不到我的注释.然而奇怪的是,我可以在那里看到注释框,但看不到绘制的路径.它适用于普通 pdf(没有密码 pdf).知道如何为受密码保护的 pdf 保存注释吗?

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?

下面是我使用的代码:

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

推荐答案

我不认为有不同的方法可以为受密码保护的文件保存注释.添加注释后保存 PDF.还要检查您正在使用的带有 alpha 的颜色代码.

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天全站免登陆