问题
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