Select all text on the page

Hello guys. Could you help me with Document Editor. 

How to select all text on the page where I put caret.


3 Replies 1 reply marked as answer

SI Suresh Iyappan Syncfusion Team July 4, 2024 07:19 PM UTC

Hi Oleksandr Kovalenko,

Thank You for reaching out to us. We are sorry to let you know that selecting all the text in the particular page where the caret is being is placed is not possible in document editor.

Regards,
Suresh I



OK Oleksandr Kovalenko replied to Suresh Iyappan July 5, 2024 12:49 PM UTC

I see, other question. Do you have the ability to delete a page by page number? 

A little more information what I need, I have a form with dynamical fields. When user change values or add new field, I need to delete an existing page and create a new one



SI Suresh Iyappan Syncfusion Team July 8, 2024 06:42 PM UTC

Hi Oleksandr Kovalenko,

We cannot delete a page only based on selecting the page number. Since Word documents are flow-type documents in which the positions of each elements are not fixed rather if any other elements are inserted or removed it changes its position relatively according to it.
To achieve this we can use an alternative approach. We can use the 
goToPage API in Selection module

to move the selection to the start of the specified page number. We can then obtain the hierarchical index position based on the cursor point and navigate to the end of the page by moving to the next page and obtaining the position of its previous element. This allows us to delete the contents between the start and end points.


Disclaimer : There may be a chance of data loss when using the above logic. Since it is a selection-based approach, any element inside the selection could be affected. As it’s a flow document, if any elements like tables are split between pages, there is a possibility of data loss. So Use this logic at your own risk.


Regards,
Suresh I


Marked as answer
Loader.
Up arrow icon