1

I have to listen AnnotationModified event as shown below. But not sure on how/when because CurentPdfViewCtrlFragment is null.

Am using pdftron.PDF.Controls.DocumentView2 as given in this sample https://github.com/PDFTron/xamarin-forms-sample

enter image description here

enter image description here

2 Answers2

2

You should override the OnTabDocumentLoadedEvent to ensure that the fragment is not null

https://www.pdftron.com/api/xamarinandroid/tools/api/pdftron.PDF.Controls.DocumentView2.html#pdftron_PDF_Controls_DocumentView2_OnTabDocumentLoaded_System_String_

Andrew
  • 46
  • 2
0

I have to use MPdfViewCtrlTabHostFragment.CurrentPdfViewCtrlFragment not base.Viewer.CurrentPdfViewCtrlFragment

Following code change works fine

mDocumentView.MPdfViewCtrlTabHostFragment.CurrentPdfViewCtrlFragment.ToolManager.AnnotationsModified += ToolManager_AnnotationsModified
  • As Andrew pointed out I have actually subscribed to TabDocumentLoaded event and using that I have subscribed to AnnotationModifed event as shown above. – Balaji Gunasekaran Jul 26 '21 at 12:01