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
}
|
pdfViewerControl.FreeTextPopupDisappeared += PdfViewerControl_FreeTextPopupDisappeared;
private void PdfViewerControl_FreeTextPopupDisappeared(object sender, FreeTextPopupDisappearedEventArgs args)
{
pdfViewerControl.AnnotationMode = AnnotationMode.FreeText;
} |
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;
}
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;
}
|
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.We are setting annotation mode to none first. 2.Then we trigger the FreeTextPopupDisappeared event. |
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?
|
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. |