FreeTextAnnotation mode lost after first save

Hi there,

I have a pdfviewer on which I set annotation mode to free text. When the application starts, on first tap on PdfViewer, the function "PdfViewerCtrl1_FreeTextAnnotationAdded" gets called. However, on subsequent taps I dont get this free text pop up anymore. What needs to be done to keep this behav


XAML:

                        <syncfusion:SfPdfViewer Grid.Row="1" Grid.Column="0" x:Name="pdfViewerCtrl1"

                                                    PageViewMode="Continuous" TextSelectionCompleted="pdfViewerCtrl1_TextSelectionCompleted" BookmarkNavigationEnabled="False" ZoomPercentage="50"/>


XAML.cs:

                        pdfViewerCtrl1.AnnotationMode = AnnotationMode.FreeText;

                        pdfViewerCtrl1.FreeTextAnnotationAdded += PdfViewerCtrl1_FreeTextAnnotationAdded;


private function:

        private void PdfViewerCtrl1_FreeTextAnnotationAdded(object sender, FreeTextAnnotationAddedEventArgs args)

        {

               //save user typed value here


         }






10 Replies

SP SarathKumar Prakash Syncfusion Team January 3, 2022 12:40 PM UTC

Hi Sri Velic, 
 
We were able to reproduce the issue, “FreeTextAnnotation mode lost after first save”. Currently, we are validating this issue and we will update the further details on January 05, 2022.   
 
Regards, 
Sarath Kumar. 



SP SarathKumar Prakash Syncfusion Team January 5, 2022 01:56 PM UTC

Hi Sri velic, 
 
On validating,We found that this is not issue and it is actual behaviour.Freetext mode will be cancelled when clicking “cancel” or “ok” button in popup window.You can trigger the free text mode using FreeTextPopupDisappeared event.It will be triggered when popup disappear.
Code snippet:
 
pdfViewerControl.FreeTextPopupDisappeared += PdfViewerControl_FreeTextPopupDisappeared; 
private void PdfViewerControl_FreeTextPopupDisappeared(object sender, FreeTextPopupDisappearedEventArgs args) 
        { 
            pdfViewerControl.AnnotationMode = AnnotationMode.FreeText; 
        } 
 
 
Regards, 
Sarath Kumar. 



SV sri velic replied to SarathKumar Prakash January 8, 2022 05:25 PM UTC

Hi SarathKumar Prakash,


Thank you for looking into this issue. Unfortunately, the solution you provided did not work. On the first tap the pop up appears on pdfviewerctrl1. when I type and hit ok. The popup disappeared. My debugger stopped at resetting the annotation mode to Free text. However, on subsequent tap anywhere else on the screen the popup never appears.

Here is the code snippet I have:


        protected override void OnAppearing()

        {

            base.OnAppearing();

//load the document here

 pdfViewerCtrl1.AnnotationMode = AnnotationMode.FreeText;

pdfViewerCtrl1.FreeTextPopupDisappeared += PdfViewerCtrl1_FreeTextPopupDisappeared;

}


        private void PdfViewerCtrl1_FreeTextPopupDisappeared(object sender, FreeTextPopupDisappearedEventArgs args)

        {

            pdfViewerCtrl1.AnnotationMode = AnnotationMode.FreeText;

        }




SP SarathKumar Prakash Syncfusion Team January 10, 2022 12:45 PM UTC

Hi Sri velic,

We are checking on this issue and we will update the further details on January 12, 2022. 
  
Regards,
Sarath Kumar.
 



SP SarathKumar Prakash Syncfusion Team January 13, 2022 04:28 AM UTC

Hi Sri Velic, 
  
We have confirmed that the issue “Free text mode working properly when setting it in the FreeTextPopupDisappeared event” is a defect and logged a defect report for this issue. The patch for this issue will be delivered on February 2, 2022. 
  
Regards 
Sarath Kumar. 



SP SarathKumar Prakash Syncfusion Team February 2, 2022 01:13 PM UTC

Hi Sri Velic,  
 
We have resolved the issue Free text mode working properly when setting it in the FreeTextPopupDisappeared event and the custom NuGet for the same can be downloaded from the following link.        
Disclaimer: Please note that we have created this NuGet for version 19.4.0.48 specifically to resolve the following issue reported in this forum 171610 
Note : Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.              
https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache            
This fix will be included in our 2022 Volume 1 main release which is expected to be available in the month of March 2022.  
 
  
Regards,
Sarath Kumar.
 



SV sri velic February 6, 2022 10:06 PM UTC

Hi SarathKumar,

This is great. Can you tell me how to use this option now? Do we still need to set the annotation back to Free text as shown below? I still dont see any change in behavior with version 19.4.0.48.


  protected override void OnAppearing()

        {

            base.OnAppearing();

//load the document here

 pdfViewerCtrl1.AnnotationMode = AnnotationMode.FreeText;

pdfViewerCtrl1.FreeTextPopupDisappeared += PdfViewerCtrl1_FreeTextPopupDisappeared;

}


        private void PdfViewerCtrl1_FreeTextPopupDisappeared(object sender, FreeTextPopupDisappearedEventArgs args)

        {

            pdfViewerCtrl1.AnnotationMode = AnnotationMode.FreeText;

        }



SP SarathKumar Prakash Syncfusion Team February 7, 2022 02:55 PM UTC

Hi Sri Velic, 
 
 Can you tell me how to use this option now? Do we still need to set the annotation back to Free text as shown below? 
Yes, we need to set free text annotation to achieve your requirement.
Code snippet:
 
I still dont see any change in behavior with version 19.4.0.48. 
Initial behaviour:
While free text popup disappearing,
1.We would trigger the
FreeTextPopupDisappeared event first.
2.Then we are setting annotation mode to none.

Current behaviour:
While free text popup disappearing,
1.W
e are setting annotation mode to none first.
2.Then we trigger the FreeTextPopupDisappeared event. 
 
Regards, 
Sarath Kumar. 



SV sri velic February 13, 2022 07:54 PM UTC

With the above code, the free text annotation box appears first time when I click on pdf document. However, on subsequent taps, text box never appears. Does the above change bring up text box on every tap or click? If so, does it interfere with scrolling up/down and other events on the pdfviewer?



SP SarathKumar Prakash Syncfusion Team February 14, 2022 07:25 AM UTC

Hi Sri Velic,

 
With the above code, the free text annotation box appears first time when I click on pdf document. However, on subsequent taps, text box never appears. Does the above change bring up text box on every tap or click?  
Code snippet we provided in previous update will work on subsequent taps.Please clear the NuGet cache and then install patched NuGet If the issue is still occurring in custom nuget which we provided. We have moved this issue fix in weekly package release(v19.4.0.50).You can use this weekly nuget package if you still find the issue with custom nuget. 
If so, does it interfere with scrolling up/down and other events on the pdfviewer? 
Yes.It will interfere with scrolling and you can scroll only with scrollhead dragging. 
 
Regards,
Sarath Kumar.
 


Loader.
Up arrow icon