We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

FreeTextAnnotation Canceled Working differently

I have a custom toolbar. When the Free Text button is clicked, the annotation mode gets set to AnnotationMode.FreeText. When you tap on the screen, a prompt opens with a keyboard, allowing the user to type something, press cancel(X) in the top left or done(a checkmark) in the top right. Currently, I'm experiencing different functionalities on iOS and Android. In iOS, when the cancel button is clicked, the prompt disappears and the annotation mode gets set back to none and I can continue scrolling the pdf. In Android, when the cancel button is clicked, the prompt disappears but the button remains in the free text mode and I cannot scroll. When I try to scroll, another prompt is brought up because it gets registered as a tap event. 

Is there any way to intercept the cancel button? I toggle my Free Text button with two images, one in the normal, unselected state and another filled-in button signifying that the button is selected. When the cancel button is pressed, I want to deselect the Free Text button and cancel the free text annotation mode in both platforms.

4 Replies

ZC Zach Carls February 5, 2019 03:06 PM

Note: I've tried using FreeTextPopupDisappeared but it isn't being called.

KK Karthik Krishnaraj Syncfusion Team February 6, 2019 07:46 AM

Hi Kristen, 
On checking the behavior in Adobe reader mobile, we could see that the free text annotation text box is displayed again even if click the cancel button and then tap on PDF document. Free text annotation text box will be disappeared completely only when we deselect the free text annotation. So, we will consider this as behavior and implement the same in Xamarin.Forms(iOS and UWP) any of our upcoming release. 
However, to avoid popping up the free text popup on tapping the PDF document even if click the cancel button, we suggest you set the AnnotationMode property to none in FreeTextPopupDisappeared event which is raised when free text popup disappeared by clicking Ok or Cancel button in your custom toolbar sample. 
Please find the code snippet below for your reference. 
pdfViewerControl.FreeTextPopupDisappeared += PdfViewerControl_FreeTextPopupDisappeared; 
private void PdfViewerControl_FreeTextPopupDisappeared(object sender, FreeTextPopupDisappearedEventArgs args) 
pdfViewerControl.AnnotationMode = AnnotationMode.None; 

ZC Zach Carls February 6, 2019 09:39 AM

I have a breakpoint set in my FreeTextPopupDisappeared event and it isn't being called in iOS, only in Android. 

KK Karthik Krishnaraj Syncfusion Team February 7, 2019 08:16 AM

Hi Kristen, 
We were able to reproduce the issue with “FreeText annotation popup disappeared event haven’t triggered” in Xamarin.Forms.iOS is a defect from our side. The fix for the reported issue will be included in our Essential Studio 2019 Volume 1 release which will be rolled out in the month of March 2019. 

Live Chat Icon For mobile
Up arrow icon