4

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();
Manoj
  • 2,799
  • 5
  • 30
  • 49

1 Answers1

0

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.

Ganesh Kanna
  • 2,269
  • 1
  • 19
  • 29