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