Undo, bookmark, and image resizing

hi team,

I'm still working on images insertion in the document editor,
my insertions trigger a bookmark's creation after auto selecting the inserted image, to easily retrieve images in document.
  • editor.insertImage(src, width, height);
  • selection.extendBackward();
  • editor.insertBookmark(`in_doc_${data.id}`);

So, after the insertion, I got 2 undoStacks with the following actions : "InsertInline", then  "InsertBookmark", everything is ok.

The problem comes now, when I resize this image, the undoStack action is again "InsertBookmark", instead of "ImageResizing", if I resize the image a second time, I got the undoStack's action "ImageResizing".

I need to target the action, to get the new size of the image, if the user resizes only one time, my code will miss the resizing informations.


I got another question, about the print method, it permits to the user to print or generate a pdf, is it possible to send this pdf to a server to save it ?

Regards, 
François

21 Replies 1 reply marked as answer

HC Harini Chellappa Syncfusion Team July 4, 2020 06:12 AM UTC

Hi François, 

Please find the details of your query from below table. 

I'm still working on images insertion in the document editor, 
my insertions trigger a bookmark's creation after auto selecting the inserted image, to easily retrieve images in document. 
editor.insertImage(src, width, height); 
selection.extendBackward(); 
editor.insertBookmark(`in_doc_${data.id}`); 
 
So, after the insertion, I got 2 undoStacks with the following actions : "InsertInline", then  "InsertBookmark", everything is ok. 

The problem comes now, when I resize this image, the undoStack action is again "InsertBookmark", instead of "ImageResizing", if I resize the image a second time, I got the undoStack's action "ImageResizing". 

I need to target the action, to get the new size of the image, if the user resizes only one time, my code will miss the resizing informations. 
Can you please share which version of document editor you are using? 

We couldn’t reproduce the reported scenario in latest version. 

Kindly check with below stack blitz sample.  

it permits to the user to print or generate a pdf, is it possible to send this pdf to a server to save it? 

Document editor doesn’t provide support to convert to PDF. Hence, we need to convert it as docx document and with the help of DocIO in server-side, we can convert that document to PDF. 

You can refer the sample from below link, where the document editor content passed as sfdt string from client-side is saved as docx stream, which is then passed to DocIO for PDF conversion. 



Regards, 

Harini C 



FR François July 6, 2020 09:57 AM UTC

Hi Harini,

I updated the stackblitz sample to show you (in the onLoadDefault function):
https://stackblitz.com/edit/react-bku2uh-6tr823

By checking the console,
you will see the actions : 
the insert image and bookmark are good,
then, if you resize the image, the actions are not updated but the contentChange event is triggered , so the last undo action is still "InsertBookmark",
if you resize a second time, the thrid action is now "ImageResizing".

So for 4 actions we only get "InsertInline,InsertBookmark,ImageResizing", we should get "InsertInline,InsertBookmark,ImageResizing,ImageResizing"


HC Harini Chellappa Syncfusion Team July 7, 2020 02:23 PM UTC

Hi François, 

Thank you for the update. 

Currently we are checking on this. will update further details by July 9th, 2020. 

Regards, 

Harini C 



FR François August 3, 2020 09:31 AM UTC

Hi,

Do you have any update about this behavior?

Regards,
François


HC Harini Chellappa Syncfusion Team August 4, 2020 06:39 AM UTC

Hi Francois, 

Apologies for the delay. 

We have considered the reported scenario as bug and logged defect report. Fix will be included in our upcoming EJ2 patch release which is tentatively scheduled on Aug 19th, 2020. Once included, we will update you. You can also track bug fix status from below link. 


Regards, 

Harini C 



HC Harini Chellappa Syncfusion Team August 21, 2020 01:11 PM UTC

Hi Francois,  

We're sorry to not make it possible to include the fix for this issue in latest patch release v18.2.54. will include this in our upcoming EJ2 patch release which is tentatively scheduled on Aug 26th, 2020. You can track the fix status from below link. 


We deeply regret for the inconvenience caused. 

Regards, 

Harini C 



HC Harini Chellappa Syncfusion Team August 26, 2020 03:45 PM UTC

Hi Francois, 

We are glad to announce that our EJ2 patch release v18.2.55 has been rolled out successfully and included fix for the reported scenario. 

kindly upgrade your packages to latest version 18.2.55 to resolve the reported scenario. 

kindly check it and let us know if you have any questions. 


Regards, 

Harini C 


Marked as answer

FR François August 27, 2020 10:05 AM UTC

Hi,

Thanks for this update, I upgraded the packages to version 55.
The "ImageResizing" action is now well registred, well done!

Feedback about the update : 
I had issues about the "selectionChange" event, it is triggered before the "created" event without any action from the user, so my component crashed.
Now I have to check if the "created" event has been triggered before handling the "selectionChange" event, is that the regular behavior of this event?

(usage : I use the selectionChange for a dynamic custom toolbar, for example showing the font size of the selection)


HC Harini Chellappa Syncfusion Team August 28, 2020 04:35 PM UTC

Hi François, 

Can you please confirm whether you are using document editor created event? Initially document editor’s created event will get trigger. once component created, control will get focus and selection change gets triggered. 

Please check the below sample. 


Can you please share how you are using created event? If possible, please share a simple sample or modify the above sample on how you are using events in your end. It will be helpful for us to provide solution at the earliest. 

Regards, 

Harini C 



FR François August 31, 2020 08:06 AM UTC

Hi Harini,

I updated the stackblitz sample, check this : https://stackblitz.com/edit/react-bku2uh-phyeud?file=index.js

So I created a new component in index.js, called Default2, I'm using React hooks and function components, using like this, you will see in the console that the selection event is triggered before the created event.

Should I not use the DocumentEditorComponent this way?


HC Harini Chellappa Syncfusion Team September 1, 2020 05:15 PM UTC

Hi François, 

We have checked the reported scenario. Selection change gets triggered before created event for document editor component. We have considered this as bug and logged defect report. Fix will be included in our upcoming EJ2 patch release which is tentatively scheduled on Sep 16th, 2020. Once included will update you. You can also track the status from below link. 


Regards, 

Harini C 



HC Harini Chellappa Syncfusion Team September 16, 2020 11:58 AM UTC

Hi Francois, 

We have included fix for the reported scenario. But facing issue on the reported scenario. Fix will be included in our upcoming EJ2 patch release which is tentatively scheduled on Sep 23rd, 2020. Once included, will update you. You can track the status from below link. 

  
Regards, 

Harini C 



HC Harini Chellappa Syncfusion Team September 24, 2020 03:17 PM UTC

Hi Francois, 

We deeply regret for the inconvenience caused. 
  
Will include fix for this in our upcoming EJ2 patch release which is tentatively scheduled on Oct 7th, 2020. Will update you, once included. You can track the status from below link. If fixed earlier, we will share the custom NuGet. 


Regards, 

Harini C 



SR Stephen Raj Chandra Sekar Syncfusion Team October 7, 2020 04:56 PM UTC

Hi Francois, 
 
 
Due to some technical issues, Oct 7th patch release is postponed and rescheduled on Oct 14th, 2020. Will update, once included. you can track the status from below feedback link 
 
 
 
Regards, 
Stephen Raj 



HC Harini Chellappa Syncfusion Team October 14, 2020 04:57 PM UTC

Hi Francois, 

Sorry for the inconvenient caused. 

we are facing some difficulties to include the below promised issue. we are checking this issue with high priority. we will share the fix in our upcoming release which scheduled by October 21,2020 
Regards, 

Harini C 



SR Stephen Raj Chandra Sekar Syncfusion Team October 25, 2020 08:57 AM UTC

Hi Francois, 

Sorry for the inconvenience. 

Fix is in our core level logic, we are facing some difficulties how to proceed on this. Will include the fix in our EJ2 patch release which scheduled on November 5th,2020. 

Regards, 
Stephen Raj


HC Harini Chellappa Syncfusion Team November 5, 2020 03:09 PM UTC

Hi Francois, 
 
Sorry for the inconvenient caused. 
 
we are facing some difficulties to include the fix for reported issue. Currently, we are validating further on how to proceed fix for this issue. will update further details on or before Nov 9,2020. 
 
Regards, 
 
Harini C 



SR Stephen Raj Chandra Sekar Syncfusion Team November 10, 2020 03:39 AM UTC

Hi Francois, 
 
Sorry for the inconvenient caused. 
 
We are checking this issue with core team on how to proceed. Currently, we are working on this high prority will update further details on or before Nov 11,2020. 
 
Regards, 
Stephen Raj


SM Suriya Murugan Syncfusion Team November 12, 2020 03:51 AM UTC

Hi Francois, 
 
We are internally checking the issue in our core architecture. We will update you once fixed. As a workaround, you can use Boolean(isCreated) to prevent triggering selection change before created event. 
 
Please check below image: 
 
 
 
  
Please let us know if you have any concerns 
 
Regards, 
 
Suriya M.


FR François November 12, 2020 12:45 PM UTC

Hi,

Tank you for your messages. I'm already using this workaround :) 
so no problem, I'm waiting for your next versions with patience.

Wish you good luck for this bug!


HC Harini Chellappa Syncfusion Team November 13, 2020 04:49 AM UTC

Hi Francois,  
 
Thank you. Will update you once fixed. 
 
Regards, 
 
Harini C 


Loader.
Up arrow icon