Some test text!

menu
search

Show and hide existing annotations

This tutorial only applies to Xamarin.Android.

By default, PDFViewCtrl shows all annotations on PDF document. If you want to hide a particular annotation on PDFViewCtrl, or hide all annotations on PDFViewCtrl, you can hide annotations as follows:

linkShow and hide one annotation

To show a hidden annotation in PDFViewCtrl, call ShowAnnotation:

void ShowAnnotation(PDFViewCtrl pdfViewCtrl, Annot annot, int annotPageNum) {
  pdfViewCtrl.ShowAnnotation(annot);
  pdfViewCtrl.Update(annot, annotPageNum);
}

To hide an annotation in PDFViewCtrl, call HideAnnotation.

void HideAnnotation(PDFViewCtrl pdfViewCtrl, Annot annot, int annotPageNum) {
  pdfViewCtrl.HideAnnotation(annot);
  pdfViewCtrl.Update(annot, annotPageNum);
}
After hide and show an annotation in PDFViewCtrl, You must call update to redraw the area covered with the given annotation.

linkShow and hide all annotations

Alternatively, you can show/hide all annotations in PDFViewCtrl by calling setDrawAnnotations(boolean). This method toggles the visibility of annotations and form fields.

For example, disabling all annotations and form fields from rendering:

pdfViewCtrl.SetDrawAnnotations(false);
pdfViewCtrl.Update(true);
After toggling annotation and form fields visibility in PDFViewCtrl, You must call update to redraw the pdf content.

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn more
close