I am trying to save the document after annotating it
final Object saveDocumentLock = new Object();
synchronized (saveDocumentLock) {
if (mPDFDoc != null) {
boolean locked = false;
try {
// When trying to execute the following if condition, it always returns false
if (mPDFDoc.tryLock()) {
locked = true;
if (mPDFDoc.isModified()) {
if (mCurrentFile.canWrite()) {
if (mCurrentFile.getAbsolutePath().equalsIgnoreCase(getTempDraftPathWithFile(fileName))) {
Log.v("", ":::::@ save on tempfile");
mPDFDoc.save(mCurrentFile.getAbsolutePath(), SDFDoc.e_incremental, null);
} else {
Log.v("", ":::::@ create tempfile");
mPDFDoc.save(getTempDraftPathWithFile(fileName), SDFDoc.e_incremental, null);
}
}
}
}
} catch (PDFNetException e) {
} finally {
try {
if (locked) {
mPDFDoc.unlock();
locked = false;
}
} catch (PDFNetException e) {
}
}
}
}
I am stuck!
Please respond ASAP.