paste image in the poosition of hyperlink

 

I’ve been trying to paste a picture inside the rich text document using richtextDocAdv.Selection.InsertImage(img) but the moment I click the hyperlink the selection position value starts at the start of the document. Resetting the cursor selection position value from the richtextDocAdv. Is there a way that I can insert the image in the last selection value that I receive ? at the moment I’m recording the X and Y cords in a Point variable with the pointer_pressed event but I cannot seem to paste the image in the desired coord. 


4 Replies 1 reply marked as answer

KG Kalaivannan Ganesan Syncfusion Team May 7, 2021 04:26 PM UTC

Hi Hector,

Thanks for contacting Syncfusion support.

We can reproduce the reported issue “Selection moved to the document start, on clicking the hyperlink”, we will validate and update you with further details on 11th May 2021.

Regarding Image insertion in the selection:
The image can be inserted in the current caret position by using the following built-in command and method.

1. InsertPictureCommand

2. RichTextBoxAdv.Selection.InsertPicture(), to know more about the method and command please refer to the below link

Command: https://help.syncfusion.com/uwp/richtextbox/commands

InsertPicture() :
https://help.syncfusion.com/cr/uwp/Syncfusion.UI.Xaml.RichTextBoxAdv.SelectionAdv.html#Syncfusion_UI_Xaml_RichTextBoxAdv_SelectionAdv_InsertPicture_System_Object_

Also created a sample to demonstrate the same which can be downloaded from the below location.
https://www.syncfusion.com/downloads/support/forum/165232/ze/RTE_InsertImage-548833458

Please let us know if you have any other questions.

Regards,
Kalaivannan
 
 
 


PS Premkumar Sundaramoorthy Syncfusion Team May 11, 2021 02:28 PM UTC

Hi Hector,

Thanks for your patience,

To proceed further on this we need some more details about the reported issue. So please confirm us whether you are performing normal click or ctrl + click on hyperlink.

Because on performing normal click on hyperlink the cursor placed properly, the issue “Selection moved to document start” occurs only on performing ctrl + click on hyperlink, without invoking the hyperlink navigation event.

Hyperlink Navigation:
The SfRichTextBoxAdv supports event to identify whenever hyperlink navigation is requested (ctrl + click). This allows you to easily customize the hyperlink navigation functionality.

Please use the following link to know more about the hyperlink navigation,
https://help.syncfusion.com/uwp/richtextbox/hyperlink#hyperlink-navigation

Please let us know if you have any other questions.

Regards,
Premkumar


Marked as answer

HA Hector Asencio May 14, 2021 03:35 PM UTC

Thanks you for your help. Using the links provides and digging into the code and some more research we manage to attain the desired result.


PS Premkumar Sundaramoorthy Syncfusion Team May 17, 2021 07:08 AM UTC

Hi Hector,

Thanks for your update. Please let us know if you need any further assistance.

Regards,
Premkumar 


Loader.
Up arrow icon