How to disable and enable a particular annotation using android sdk


Our requirement is to drag the annotation with over-layer it should move the inserted annotation together and place it where i need.

The below steps which i followed to implement the above feature in

  • upon selecting annotation, removing annotation from page using this method “page.annotRemove(mAnnot)”.

Page page = mPDFView.getDoc().getPage(mAnnotPageNum);
mPDFView.update(mAnnot, mAnnotPageNum); // This step makes the pdf page blurriness.

  • Redraw the shape on client side using “canvas.drawBitmap

  • moved the client shape around while dragging

  • onUp listener inserting annotation back to the page using this method “page.annotInsert(0,mAnnot)

Page page = mPDFView.getDoc().getPage(mAnnotPageNum);
page.annotInsert(0, mAnnot);
mPDFView.update(mAnnot, mAnnotPageNum);

Please let me know if above step are correct? or Is there any better way to implement the above feature?

When I remove the annotation from page and update, around the annotation there will be blurriness in the page this happens only when i remove annotation from page, no issues while inserting annotation. How to fix this? or Is there better way to disable/enable a selected annotation from page?

Sivakumar s.

You may want to try mPDFView.waitForRendering():

Hi Aaron,

Is there no option to disable/enable annotation instead of removing and inserting annotation?

PDFNet does not provide a way to enable or disable individual annotation rendering. You can, however, disable rendering of all annotations with PDFViewCtrl.setDrawAnnotations: