How to save annotation on password protected pdf using MuPDF

血红的双手。 提交于 2019-12-23 14:24:11

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/28585742/how-to-save-annotation-on-password-protected-pdf-using-mupdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!